Hi Guys,
I am trying to get gwi to work on a remote server and am getting the following error message:
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I can run the command agaist my localhost :
Get-WmiObject Win32_UserAccount -computername Localhost -filter "localaccount=true" | Select-Object name, description, status, lockout, passwordExpires | ft -AutoSize
But when I run it agaist a server on my network I get access denied?
Get-WmiObject Win32_UserAccount -computername server01 -filter "localaccount=true" -credential $cred | Select-Object name, description, status, lockout, passwordExpires | ft -AutoSize
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:1 char:14 + Get-WmiObject <<<< Win32_UserAccount -computername server01 -filter "localaccount=true" -crede ntial $cred | Select-Object name, description, status, lockout, passwordExpires | ft -AutoSize
I have also tried running powershell using the runas and using my domain admin account.
Has anyone else had this issue?
Cheers
James