简体   繁体   中英

Powershell Active Directory Module in Remote Session

Hi does anyone have any experience of how to get the Active Directory module to work in a remote ps session? Nothing I'm trying seems to work. My remoting between the computers are fine and working and they are joined to a domain. Lets say I do this

$Session = New-PSSession -ComputerName DC01
Invoke-Command -Session $Session {Import-Module Active Directory}
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.'.

If I logon to the server directly it works fine. Tried creating a SessionConfiguration also and told it to load the AD module but no luck there either.

May be the dreaded "double hop authentication" problem. Since you already have a Session Configuration set up, you can try adding -RunAs to that and see if it starts working:

http://www.vinithmenon.com/2012/11/delegated-administration-in-windows.html

I found the solution to my problem. I enabled CredSSP on the server again from scratch and on my client and now it's working :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM