Hy... I am trying to connect to a remote computer using WMI and C#. I get an error: The RPC server is unavailable. (Exception result HRESULT: 0x800706BA). I don t know if that is code related so this is what I m using:
serverN = InputText.Text;//serverN=IPAddress
userN = userName.Text;
passN = passName.Text;
if (String.IsNullOrEmpty(serverN))
serverN = ".";
ManagementClass manC = new ManagementClass("Win32_LogicalDisk");
string strScope = string.Format(@"\{0}
ootcimv2", serverN);
ConnectionOptions conOpt = new ConnectionOptions();
conOpt.Username = userN;
conOpt.Password = passN;
manC.Scope = new ManagementScope(strScope, conOpt);
When I try to get instances from manC I catch the exception with the RPC being unavailable. Locally it works so I m guessing that I have to make some settings on the remote machine (OS: Windows XP sp2). I have checked so that it allows remote connections and I have inserted command netsh firewall set service RemoteAdmin into command prompt. Do I need to set a domain name or a networkid? Or it is something else I m missing?