Get-WmiObject : The RPC Server is Unavailable. (Exception from HRESULT: 0x800706BA)

This week while working with some PowerShell scripts that retrieve WMI information from remote servers, I ran into an issue where I was able to return results from Windows 2008 R2 servers without issue but was unable to return results from Windows 2008 (non-R2) servers even though they had PowerShell 2.0 installed and as far as I could tell they were configured exactly the same as the Windows 2008 R2 servers.

Here’s the error I received:

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At D:Get-MachineInfo.ps1:18 char:14 + Get-WmiObject «« -class Win32_OperatingSystem ` + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

gwmi-error1.png

Enabling “Remote Administration” in the firewall on the Windows Server 2008 (non-R2) servers resolved this issue.

gwmi-error2.png

I verified this firewall exception was not allowed on the Windows 2008 R2 servers since those worked without issue, but it does appear that it’s required on the non-R2 servers.

ยต