We are trying to connect to a remote server via Powershell and use the ActiveDirectory module. When trying to do this locally, everything seems to be fine.
PS C:\Users\bar> Import-Module ActiveDirectory
PS C:\Users\bar> Get-ADUser 'baz'
DistinguishedName : CN=Foo Baz,OU=baz.myhost.com,OU=FooMachine,DC=foo,DC=blah,DC=loc
Enabled : True
GivenName : Baz
Name : Foo Baz
ObjectClass : user
ObjectGUID : <some guid>
SamAccountName : baz
SID : <more info here>
Surname : Baz
UserPrincipalName : baz@foo
When we do the samething remotely, we are not so lucky.
C:\> Enter-PSSession -ComputerName 172.1.2.3 -Credential foo\bar
[172.1.2.3]: PS C:\Users\bar\Documents> Import-Module ActiveDirectory
WARNING: Error initializing default drive: 'Unable to contact the server. This
may be because this server does not exist, it is currently down, or it does not
have the Active Directory Web Services running.'.
[172.1.2.3]: PS C:\Users\bar\Documents> Get-ADUser 'baz'
Unable to contact the server. This may be because this server does not exist, i
t is currently down, or it does not have the Active Directory Web Services runn
ing.
+ CategoryInfo :
+ FullyQualifiedErrorId : Unable to contact the server. This may be becaus
e this server does not exist, it is currently down, or it does not have th
e Active Directory Web Services running.,Microsoft.ActiveDirectory.Managem
ent.Commands.GetADUser
[172.1.2.3]: PS C:\Users\bar\Documents>
Christopher, we have 2 – 2008 R2 domain controllers running in that domain. The active directory web service is running on both ( "Import-Module ActiveDirectory" works fine on the server console – it is not a domain controller by the way
Best Answer
Would CREDSSP be required in this scenario anyone?