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

*爱你&永不变心* 提交于 2019-12-18 16:57:44

问题


My application requirement is like below. Application will run on domain admin system which will ping all machine under that domain, it will take disk drive, CPU and RAM details from all domain systems.

Whenever I'm trying to ping machine I'm getting error that

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

Code I'm using to connect remote machine is

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();

回答1:


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

  1. Open Windows Firewall.
  2. Allow app or feature through Windows Firewall.
  3. Enable Domain Privilege for Windows Management Instrumentation(WMI).

There are some other things also that you can check.

  1. The remote computer is blocked by the firewall.
    Solution: Open the Group Policy Object Editor snap-in (gpedit.msc) to edit the Group Policy object (GPO) that is used to manage Windows Firewall settings in your organization. Open Computer Configuration, open Administrative Templates, open Network, open Network Connections, open Windows Firewall, and then open either Domain Profile or Standard Profile, depending on which profile you want to configure. Enable the following exception: Allow Remote Administration Exception and Allow File and Printer Sharing Exception.
  2. Host name or IP address is wrong or the remote computer is shutdown.
    Solution: Verify correct host name or IP address.
  3. The "TCP/IP NetBIOS Helper" service isn't running.
    Solution: Verity that "TCP/IP NetBIOS Helper" is running and set to auto start after restart.
  4. The "Remote Procedure Call (RPC)" service is not running on the remote computer.
    Solution: Open services.msc using Windows Run. In Windows Services, Verify that Remote Procedure Call (RPC) is running and set to auto start after restart.
  5. The "Windows Management Instrumentation" service is not running on the remote computer.
    Solution: Open services.msc using Windows Run. Verity that Windows Management Instrumentation service is running and set to auto start after restart.



回答2:


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

The code is running fine when I'm adding domain admin under remote machine's WMI Control remote security property. please check below screenshot.

I doubt that this is really true. When you don't have permission to access WMI you usually get Access is denied error.



来源:https://stackoverflow.com/questions/25499050/wmi-the-rpc-server-is-unavailable-exception-from-hresult-0x800706ba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!