Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

powershell

When I run

Get-WmiObject win32_SystemEnclosure -Computer hostname | select serialnumber 

it works for both local and remote hosts.

When I do this for a list of hosts using

ForEach ($_ in gc u:\pub\list.txt) {     Get-WmiObject win32_SystemEnclosure -Computer $_ | select serialnumber | format-table -auto @{Label="Hostname"; Expression={$_}}, @{Label="Service Tag"; Expression={$_.serialnumber}} } 

it returns

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

like image 302
user1501778 Avatar asked Jul 04 '12 14:07

user1501778


People also ask

What is get WmiObject?

The Get-WmiObject cmdlet gets instances of WMI classes or information about the available WMI classes. To specify a remote computer, use the ComputerName parameter. If the List parameter is specified, the cmdlet gets information about the WMI classes that are available in a specified namespace.


1 Answers

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 
like image 54
David Brabant Avatar answered Sep 25 '22 13:09

David Brabant