rpc wmi 服务不可用,WMI RPC服务器不可用。 (异常来自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.

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

解决方案

I found the solution for this.

I did it by enabling Windows Management Instrumentation (WMI) rule in windows firewall.

1] 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: 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(Windows Management Instrumentation)服务相关,可能是 WMI 子系统或命名空间出现了问题。以下是一些可能的解决方法: 1. 重新启动 WMI 服务 在 Windows 搜索栏中输入“services.msc”,找到“Windows Management Instrumentation”服务,右键单击并选择“重启”。 2. 重置 WMI 服务 打开命令提示符(以管理员身份运行),输入以下命令并按回车键: ``` winmgmt /resetrepository ``` 这将重置 WMI 子系统的状态并重新构建 WMI 数据存储库。 3. 修复 WMI 子系统 打开命令提示符(以管理员身份运行),输入以下命令并按回车键: ``` winmgmt /salvagerepository %windir%\System32\wbem ``` 这将尝试修复损坏的 WMI 子系统文件,并将它们移动到重建存储库所需的位置。 4. 重新注册 WMI DLL 文件 打开命令提示符(以管理员身份运行),输入以下命令并按回车键: ``` regsvr32 wbemcons.dll regsvr32 wbemcore.dll regsvr32 wbemess.dll regsvr32 wbemsvc.dll regsvr32 fastprox.dll regsvr32 winmgmts.exe ``` 这将重新注册 WMI DLL 文件,可能会解决问题。 5. 运行系统文件检查器 打开命令提示符(以管理员身份运行),输入以下命令并按回车键: ``` sfc /scannow ``` 这将运行系统文件检查器,并尝试修复任何受损的系统文件。 如果上述解决方法都无法解决问题,可能需要重新安装操作系统或寻求专业技术支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值