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();
Best Answer
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.
Solution: Open the Group Policy Object Editor snap-in
(gpedit.msc)
to edit theGroup 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
andAllow File and Printer Sharing Exception
.Solution: Verify correct host name or IP address.
Solution: Verity that "TCP/IP NetBIOS Helper" is running and set to auto start after restart.
Solution: Open
services.msc
using Windows Run. In Windows Services, Verify thatRemote Procedure Call (RPC)
is running and set to auto start after restart.Solution: Open
services.msc
using Windows Run. Verity thatWindows Management Instrumentation
service is running and set to auto start after restart.