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

前端 未结 16 1987
失恋的感觉
失恋的感觉 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}
    
    0 讨论(0)
  • 2020-12-08 13:55

    Enabling following FW rules on target system resolved the problem on Win2k16:

    • Windows Management Instrumentation (WMI-In)
    • Distribiuted Transaction Coordinator (RPC)
    • Distribiuted Transaction Coordinator (RPC-EPMAP)
    0 讨论(0)
  • 2020-12-08 13:57

    I just came to the exact same issue and found the answer here: http://powershellcommunity.org/Forums/tabid/54/aft/7537/Default.aspx

    I had space characters at the end of each line the input file. If your file does too, just remove them and your script should work.

    0 讨论(0)
  • 2020-12-08 14:00

    I had same issue, and for me, I was trying to use an IP Address instead of computer name. Just adding this as one more potential solution for people finding this down the road.

    0 讨论(0)
  • 2020-12-08 14:01

    Thought I would add that we also ran into this issue with multiple machines in our domain. I created a list of offending machines and added them all to a text file from which to run the script. I ran this from the CMD prompt using elevated privileges.

     psexec @firewallFix.txt -d netsh advfirewall firewall 
            set rule name="Windows Management Instrumentation (WMI-In)" 
            profile=domain new enable=yes profile=domain
    
    0 讨论(0)
  • 2020-12-08 14:04

    Check that the "Windows Management Instrumentation (WMI-In)" rule is enabled in the firewall for each remote machine.

    Or in an Administrative Command/Powershell prompt run:

    netsh advfirewall firewall set rule group="Windows Management Instrumentation (WMI)" new enable=yes
    
    0 讨论(0)
提交回复
热议问题