I want to run a query (for example CIM_Memory) on a remote computer, in that case it's a virtual machine. I use this code in Powershell:
Get-WmiObject CIM_Memory -ComputerName IPADDRESS -Credential USERNAME
Of course with an actual IP and Username. RemoteAdmin is enabled on both OS (both Win7).
I'm getting this exception:
Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)
Since it's Win7 with the UAC feature, the users get an access token. So there's this registry entry:
After setting this to 1, still getting the same exception. What could be the problem?
Did you read the WMI Troubleshooting section on MSDN? Here is what is said about your error:
0x80070005 – E_ACCESS_DENIED - Access denied by DCOM security.
The user does not have remote access to the computer through DCOM. Typically, DCOM errors occur when connecting to a remote computer with a different operating system version.
Give the user Remote Launch and Remote Activation permissions in dcomcnfg. Right-click My Computer-> Properties Under COM Security, click "Edit Limits" for both sections. Give the user you want remote access, remote launch, and remote activation. Then go to DCOM Config, find "Windows Management Instrumentation", and give the user you want Remote Launch and Remote Activation. For more information, see Connecting Between Different Operating Systems
User contributions licensed under CC BY-SA 3.0