WMI:RPC服务器不可用。(尝试连接到远程计算机时抛出HRESULTexception:0x800706BA)我正在使用以下代码使用WMI连接到远程计算机:ConnectionOptionsconnOptions=newConnectionOptions();connOptions.Impersonation=ImpersonationLevel.Impersonate;connOptions.EnablePrivileges=true;connOptions.UsernamenOptions.UsernamenOptions="admin";connOptions.Password="密码";ManagementScopescope=newManagementScope(String.Format(@"\{0}ROOTCIMV2",remoteMachine),connOptions);范围.连接();我收到以下异常:RPC服务器不可用。(HRESULT异常:0x800706BA)检查了本知识库文章中描述的所有步骤,远程计算机上一切正常。用户是远程计算机上的管理员。尝试了Wbemtest工具,同样的结果有人知道发生了什么吗?提前致谢,Vasily如果您使用的是Win7,则必须以管理员身份运行该应用程序。您也可以为connOptions.Impersonation属性尝试不同的值。您是否在远程计算机上打开了RPC端口?尝试关闭两台计算机上的防火墙。此外,您需要在Windows防火墙中启用WindowsManagementInstrumentation(WMI)规则。1]Windows防火墙。2]允许应用程序或功能通过Windows防火墙。3]为WindowsManagementInstrumentation(WMI)启用权限。仍然有问题,然后点击下面的链接可能会对您有所帮助。即使关闭了所有防火墙,远程连接到WMI时我也面临这个问题。下面的命令运行,我的问题就解决了。netshadvfirewall防火墙设置规则组=“windows管理工具(wmi)”新启用=是localport=135netshadvfirewall防火墙添加规则dir=inname="WMI"program=%systemroot%system32svchost.exeservice=winmgmtaction=allowprotocol=TCPlocalport=anynetshadvfirewallfirewalladdruledir=inname="UnsecApp"program=%systemroot%system32wbemunsecapp.exeaction=allownetshadvfirewallfirewalladdruledir=outname="WMI_OUT"program=%systemroot%system32svchost.exeservice=winmgmtaction=allowprotocol=TCPlocalport=any以上是C#学习教程:WMI:RPC服务器不可用。(HRESULTexception:0x800706BAisthrownwhentryingtoconnecttoaremotecomputer)所有内容分享,如果对你有用,需要了解更多C#学习教程,希望大家多多关注。本文收集自网络,不代表立场。侵权请点击右侧联系管理员删除。如需转载请注明出处:
