【问题标题】:WMI The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)WMI RPC 服务器不可用。 (来自 HRESULT 的异常:0x800706BA)
【发布时间】:2014-10-19 09:06:03
【问题描述】:

我的申请要求如下。应用程序将在域管理系统上运行,它将 ping 该域下的所有机器,它将获取所有域系统的磁盘驱动器、CPU 和 RAM 详细信息。

每当我尝试 ping 机器时,我都会遇到错误

“RPC 服务器不可用。(HRESULT 异常:0x800706BA)”

我用来连接远程机器的代码是

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

【问题讨论】:

    标签: c# wmi rpc remote-access windows-applications


    【解决方案1】:

    我找到了解决方案。我通过在 Windows 防火墙中启用 Windows Management Instrumentation (WMI) 规则来做到这一点。

    1. 打开 Windows 防火墙。
    2. 允许应用程序或功能通过 Windows 防火墙。
    3. Windows Management Instrumentation(WMI) 启用域权限。

    您还可以检查其他一些内容。

    1. 远程计算机被防火墙阻止。
      解决方案:打开组策略对象编辑器管理单元(gpedit.msc) 以编辑用于管理 Windows 防火墙设置的Group Policy object (GPO)在您的组织中。打开计算机配置,打开管理模板,打开网络,打开网络连接,打开 Windows 防火墙,然后打开域配置文件或标准配置文件,具体取决于您要配置的配置文件。启用以下异常:Allow Remote Administration ExceptionAllow File and Printer Sharing Exception
    2. 主机名或 IP 地址错误或远程计算机已关闭。
      解决方案:验证正确的主机名或 IP 地址。
    3. “TCP/IP NetBIOS Helper”服务未运行。
      解决方案:验证“TCP/IP NetBIOS Helper”正在运行并设置为重启后自动启动。时间>
    4. “远程过程调用 (RPC)”服务未在远程计算机上运行。
      解决方案:使用 Windows 运行打开 services.msc。在 Windows 服务中,验证 Remote Procedure Call (RPC) 是否正在运行并设置为重启后自动启动。
    5. “Windows Management Instrumentation”服务未在远程计算机上运行。
      解决方案:使用 Windows Run 打开services.msc。验证Windows Management Instrumentation 服务正在运行并设置为重启后自动启动。

    【讨论】:

      【解决方案2】:

      当 Windows 防火墙(或任何其他防火墙)阻止 WMI 连接时,可能会出现错误 The RPC server is unavailable. (0x800706ba)。请参阅Connecting Through Windows Firewall 和相关文章。

      当我在远程下添加域管理员时,代码运行良好 机器的 WMI 控制远程安全属性。请检查下面 截图。

      我怀疑这是真的。当您无权访问 WMI 时,通常会收到 Access is denied 错误。

      【讨论】:

        猜你喜欢
        • 2013-05-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-04-08
        相关资源
        最近更新 更多