I'm trying to make a script for a customer so he can report users in ad.
The domain controller is running 2008 with Active Directory Web Services. Then we have installed AD Powershell tools on a 2008 R2 member server. When i try to import the module and Get-ADUser on the terminal there are no issues.
Then i try to a script that makes a New-PSSession to the 2008 R2 Invoke-Command to load ActiveDirectory module. And then Import-PSSesion to the script. But when i run the Invoke-Command i get an error:
WARNING: Error initializing default drive: 'The operation returned because the timeout limit was exceeded.'.
$session = New-PSSession -ComputerName EES-TERM1 Invoke-Command -Command {Import-Module ActiveDirectory} -Session $Session Import-PSSession -Session $session -Module ActiveDirectory PS C:\Windows\system32> Invoke-Command -Command {Import-Module ActiveDirectory} -Session $Session WARNING: Error initializing default drive: 'The operation returned because the timeout limit was exceeded.'.