Have you checked that "Enable Distributed COM on this computer" is enabled?
Have you tried using Get-CIMObject (using WinRM) instead of Get-WMIObject? how-to-confirm-winrm-and-remote-scripting
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
WMIObject: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) error for the remote computer.
My lab environment:
Running the following PS:
Get-WmiObject -query "SELECT * FROM Win32_OperatingSystem" -ComputerName DESKTOP-QN5E1DS.euclab.in
Troubleshooting already performed but no luck:
DCOM permission
Open Dcomcnfg
Expand Component Service -> Computers -> My computer
Go to the properties of My Computer
Select the COM Security Tab
Click on "Edit Limits" under Access Permissions, and ensure "Everyone" user group has "Local Access" and "Remote Access" permission.
Click on the "Edit Limit" for the launch and activation permissions, and ensure "Everyone" user group has "Local Activation" and "Local Launch" permission.
Highlight "DCOM Config" node, and right click "Windows Management and Instruments", and click Properties.
<Please add the steps to check Launch and Activation Permissions, Access Permissions, Configuration Permissions based on the default of Windows Server 2008>
Permission for the user to the WMI namespace
Open WMImgmt.msc
Go to the Properties of WMI Control
Go to the Security Tab
Select "Root" and open "Security"
Ensure "Authenticated Users" has "Execute Methods", "Provider Right" and "Enable Account" right; ensure Administrators have all permission.
Verify WMI Impersonation Rights
Click Start, click Run, type gpedit.msc, and then click OK.
Under Local Computer Policy, expand Computer Configuration, and then expand Windows Settings.
Expand Security Settings, expand Local Policies, and then click User Rights Assignment.
Verify that the SERVICE account is specifically granted Impersonate a client after authentication rights.
Detailed error:
Get-WmiObject -query "SELECT * FROM Win32_OperatingSystem" -ComputerName DESKTOP-QN5E1DS.euclab.in -Credential $cred -Verbose
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:1 char:1
Does anyone have any other ideas? or was there something I overlooked?
Have you checked that "Enable Distributed COM on this computer" is enabled?
Have you tried using Get-CIMObject (using WinRM) instead of Get-WMIObject? how-to-confirm-winrm-and-remote-scripting
Look in the namespace under WMI permisssion and make sure you have selected -
the namespace and subnamespace
For the account you have giving permission