WMI Issue: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

I am trying to remotely access WMI on machines on my network. There are a few however that are responding with the above error on the code below. I have shut down the firewall application(s) and all ports are available on the machines in question. I have checked the registry for DCOM and have made sure that RPC is running to no avail. Anyone have anything else to check?

ConnectionOptions options = new ConnectionOptions();
options.Username = "*****";
options.Password = "*****";
options.Timeout = new TimeSpan(0,0,0,5,0);
ManagementScope wmiScope = new ManagementScope(@"\\" + inDevice.IPAddress + @"\root\cimv2", options);
ObjectQuery query = new ObjectQuery("SELECT Name, UserName FROM Win32_ComputerSystem");

Open in new window

Who is Participating?
newgentechnologiesConnect With a Mentor Author Commented:
It turns out there is something wrong with the network in that part of the office...
The firewall is probably blocking it.  Try dropping the following into a file called wmifixtest.vbs:

  Set objFirewall = CreateObject("HNetCfg.FwMgr")
  Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
  Set objAdminSettings = objPolicy.RemoteAdminSettings
  objAdminSettings.Enabled = TRUE

Then save and run the vbs script.

Repeat your test.

Please be aware, this will add an exemption for WMI in the Windows Firewall.
newgentechnologiesAuthor Commented:
No change, I have turned off the Windows Firewall on this machine and it still does not access the RPC.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.