I'm trying to run a command on my other pc but I keep getting this error when i run the code.
I have enabled Domain Privilege for Windows Management Instrumentation(WMI) like this post
var hostname = "myIP"; //hostname or a IpAddress
var connection = new ConnectionOptions();
//The '.\' is for a local user on the remote machine
//Or 'mydomain\user' for a domain user
connection.Username = "myUsername";
connection.Password = "Mypass";
connection.EnablePrivileges = true;
connection.Impersonation = ImpersonationLevel.Impersonate;
connection.Authority = "ntlmdomain:" + "myworkgroup";
connection.Authentication = AuthenticationLevel.Packet;
object[] theProcessToRun = { anyCommand };
var wmiScope = new ManagementScope($@"\\{hostname}\root\cimv2", connection);
wmiScope.Connect();
I can also confirm the other PC is On and connected to the Internet(The same Internet as the PC I'm running my C# program from)
Any Ideas what else I might be missing?