I'm using the following code to connect to remote machine using WMI:
ConnectionOptions connOptions = new ConnectionOptions();
connOptions.Impersonation = ImpersonationLevel.Impersonate;
connOptions.EnablePrivileges = true;
connOptions.Username = "admin";
connOptions.Password = "password";
ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", remoteMachine), connOptions);
scope.Connect();
I'm getting the following exception: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Checked all steps described in this knowledgebase article, everything is OK on remote machine.
User is Administrator on remote machine.
Tried Wbemtest tool, the same result
Does anyone has an idea what is happening?