Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

前端 未结 16 2009
失恋的感觉
失恋的感觉 2020-12-08 13:32

When I run

Get-WmiObject win32_SystemEnclosure -Computer hostname | select serialnumber

it works for both local and remote hosts.

W

16条回答
  •  天命终不由人
    2020-12-08 13:54

    I was having the same problem but only with a few machines. I found that using Invoke-Command to run the same command on the remote server worked.

    So instead of:

    Get-WmiObject win32_SystemEnclosure -ComputerName $hostname -Authentication Negotiate
    

    Use this:

    Invoke-Command -ComputerName $hostname -Authentication Negotiate -ScriptBlock {Get-WmiObject win32_SystemEnclosure}
    

提交回复
热议问题