Hai,
I am having C#.NET windows application, to read the system info from Remote system through WMI.
For Win2003 server machine, the WMI connection is successful.
For the Machines Vista and XP , WMI connection is giving the error " RPC server is unavialable. But for the same machines , i am able get data by WMIC commands with the same credentials. What will be the problem.
Here is the code
ManagementScope wmiMgmtScope = null;
ConnectionOptions connOptions = new ConnectionOptions();
connOptions.Username ="USERNAME";
connOptions.Password ="PASSWORD";
wmiMgmtScope = new ManagementScope("\\\\" + strHost + "\\root\\cimv2", connOptions);
wmiMgmtScope.Options.Impersonation = ImpersonationLevel.Impersonate;
wmiMgmtScope.Options.EnablePrivileges = true;
try
{
wmiMgmtScope.Connect();
}