[英]WMI The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
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.
应用程序将在域管理系统上运行,它将对该域下的所有计算机执行ping操作,它将从所有域系统获取磁盘驱动器,CPU和RAM详细信息。
Whenever I'm trying to ping machine I'm getting error that 每当我尝试ping计算机时,我都会收到错误消息
"The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
“ RPC服务器不可用。(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();
I found the solution for this. 我找到了解决方案。 I did it by enabling
Windows Management Instrumentation (WMI)
rule in Windows Firewall. 我通过在Windows防火墙中启用
Windows Management Instrumentation (WMI)
规则来做到这一点。
- Open Windows Firewall.
打开Windows防火墙。
- Allow app or feature through Windows Firewall.
通过Windows防火墙允许应用或功能。
- Enable Domain Privilege for
Windows Management Instrumentation(WMI)
.为
Windows Management Instrumentation(WMI)
启用域特权。
There are some other things also that you can check. 您还可以检查其他一些内容。
(gpedit.msc)
to edit the Group Policy object (GPO)
that is used to manage Windows Firewall settings in your organization. (gpedit.msc)
以编辑用于管理组织中Windows防火墙设置的Group Policy object (GPO)
。 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. Allow Remote Administration Exception
and Allow File and Printer Sharing Exception
. Allow Remote Administration Exception
和Allow File and Printer Sharing Exception
。 services.msc
using Windows Run. services.msc
。 In Windows Services, Verify that Remote Procedure Call (RPC)
is running and set to auto start after restart. Remote Procedure Call (RPC)
是否正在运行,并将其设置为重新启动后自动启动。 services.msc
using Windows Run. services.msc
。 Verity that Windows Management Instrumentation
service is running and set to auto start after restart. Windows Management Instrumentation
服务正在运行,并设置为重新启动后自动启动。 The error The RPC server is unavailable. (0x800706ba)
错误
The RPC server is unavailable. (0x800706ba)
The RPC server is unavailable. (0x800706ba)
can occur when Windows Firewall (or any other firewall) blocks WMI connection. Windows防火墙(或任何其他防火墙)阻止WMI连接时,可能会出现
The RPC server is unavailable. (0x800706ba)
。 See Connecting Through Windows Firewall and related articles. 请参阅通过Windows防火墙连接和相关文章。
The code is running fine when I'm adding domain admin under remote machine's WMI Control remote security property.
当我在远程计算机的WMI控制远程安全属性下添加域管理员时,代码运行良好。 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. 当您没有访问WMI的权限时,通常会出现“
Access is denied
错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.