Hy ... I'm trying to connect to a remote computer using WMI and C #. I get an error: RPC server is unavailable. (Result of HRESULT exception: 0x800706BA). I don't know if this is related to the code, so this is what I use:
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}\root\cimv2", 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 will catch an exception because RPC is not available. This works locally, so I assume that I need to make some settings on a remote computer (OS: Windows XP sp2). I verified that it allowed remote connections, and I inserted the netsh firewall command to install the RemoteAdmin service on the command line. Do I need to provide a domain name or network identifier? Or is it something else I'm missing?
source share