在工作组机器上,我运行以下命令:
$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
我收到以下错误:HRESULT 异常:0x80070005 (E_ACCESSDENIED)
我已经在几台服务器上尝试过,结果相同。使用 wmimgmt.msc,我选择了根节点并验证管理员组已选中所有“允许”复选框(特殊权限除外)。
有什么想法吗?