RPC server is unavailable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DKn
    New Member
    • Aug 2007
    • 53

    RPC server is unavailable

    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;
    ConnectionOptio ns connOptions = new ConnectionOptio ns();
    connOptions.Use rname ="USERNAME";
    connOptions.Pas sword ="PASSWORD";
    wmiMgmtScope = new ManagementScope ("\\\\" + strHost + "\\root\\cimv2" , connOptions);
    wmiMgmtScope.Op tions.Impersona tion = ImpersonationLe vel.Impersonate ;
    wmiMgmtScope.Op tions.EnablePri vileges = true;
    try
    {
    wmiMgmtScope.Co nnect();
    }
Working...