WMI RPC Server is unavailable. (Exception from HRESULT: 0x800706BA)

My application requirements are as below. The application will be launched in the domain administration system, which will ping the entire machine under this domain, it will receive data on disks, CPU and RAM of all domain systems.

Whenever I try to ping a car, I get an error message

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

The code that I use to connect the remote machine,

ConnectionOptions options = new ConnectionOptions(); options.EnablePrivileges = true; options.Impersonation = ImpersonationLevel.Impersonate; options.Username = System.Configuration.ConfigurationSettings.AppSettings["AccessUserName"].ToString(); options.Password = System.Configuration.ConfigurationSettings.AppSettings["AccessPassword"].ToString(); options.Authority = "ntlmdomain:" + System.Configuration.ConfigurationSettings.AppSettings["DomainName"].ToString(); options.Authentication = AuthenticationLevel.Packet; ManagementScope scope = new ManagementScope("\\\\" + sMachineIP + "\\root\\cimv2", options); scope.Connect(); 
+5
source share
2 answers

I found a solution for this. I did this by enabling the Windows Management Instrumentation (WMI) rule in the Windows firewall.

  • Windows Firewall
  • Allow an application or feature through the Windows Firewall.
  • Enable the domain privilege for Windows Management Instrumentation (WMI).

There are other things you can check.

  • The remote computer is blocked by a firewall.
    Decision. Open the Group Policy Object Editor snap-in (gpedit.msc) to edit the Group Policy Object (GPO), which is used to manage the Windows Firewall settings in your organization. Open Computer Configuration, open Administrative Templates, open Network, open Network Connections, open Windows Firewall, and then open a domain profile or Standard Profile, depending on which profile you want to configure. Include the following exception: "Allow remote administration exception" and "Allow file and printer sharing exception."
  • Invalid host name or IP address or remote computer is turned off.
    Verify that the host name or IP address is correct.
  • The TCP / IP NetBIOS Helper service is down.
    Solution: Make sure that the "TCP / IP NetBIOS Helper" is started and configured to start automatically after a restart.
  • Remote Procedure Call (RPC) service is not running on the remote computer.
    Solution: Make sure Remote Procedure Call (RPC) is up and running to start automatically after a restart.
  • Windows Management Instrumentation service is not running on the remote computer.
    Solution: Verify that the Windows Management Tool is running and configured to start automatically after a restart.
+9
source

The RPC server is unavailable. (0x800706ba) The RPC server is unavailable. (0x800706ba) can occur when the Windows firewall (or any other firewall) blocks the WMI connection. See Connecting through the Windows Firewall and related articles.

The code works fine when I add a domain administrator under the remote machine WMI Control remote protection. check below screenshot.

I doubt that this is true. If you do not have permission to access WMI, you usually get an Access is denied error.

0
source

Source: https://habr.com/ru/post/1201123/


All Articles