0
votes

From a workgroup machine, I run the following command:

$wmi_pass = "<password>"
$wmi_user = "<username>"
$remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;
$remote_credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $wmi_user, $remote_pass;
Get-WMIObject -Query "Select DisplayName from Win32_Service where StartMode='Auto'" -ComputerName "<IP address>" -Credential $remote_credential

I get the following error: Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)

I've tried it on several servers with the same results. Using the wmimgmt.msc, I selected the Root node and verified that Administrators group has all "Allow" checkboxes selected (except Special Permission).

Any thoughts?

1

1 Answers

1
votes

To query WMI remotely a user needs DCOM-permission in addition to access to the WMI-namespaces (which you have already done). DCOM permission can be given using: