问题描述
我的应用程序的要求是类似下面。应用程序将域管理系统上运行,这将ping通所有的机器到该域下,将需要的磁盘驱动器,CPU和RAM的详细信息,从所有域的系统。
每当我试图平机我收到错误
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();
I found the solution for this.I did it by enabling Windows Management Instrumentation (WMI) rule in windows firewall.
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: Verity 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: Verity that "Windows Management Instrumentation" is running and set to auto start after restart.
这篇关于WMI RPC服务器不可用。 (异常来自HRESULT:0x800706BA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!