I want to connect to remote PC running Windows 7, from another PC using ManagementScope on a local network. On remote PC I\'ve created a new user account \"Samuel\" withou
Not sure if it is denied because the WMI engine isn't listening on the remote machine, or if you have other login/connection issues.
Here's the code I used to connect to my remote machine, and it is working perfectly. Maybe it will help you:
ConnectionOptions oConn = new ConnectionOptions();
ManagementScope oScope = null;
oConn.Username = txtLogin;
oConn.Password = txtPassword;
oConn.Authority = "ntlmdomain:" + txtDomain;
oScope = new ManagementScope("\\\\" + txtHostName + "\\root\\CIMV2", oConn);
oScope.Connect();
If my domain/login/password trio are accepted, then Connect() will work. Otherwise, Connect() throws an exception. As long as the specified credentials have permission on that machine, you should be off and running.