Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myQuery = "Select * from CIM_DataFile Where Drive = 'C:' AND Path = '\Users\someguy\Documents\' AND FileName = 'Default' AND Extension = 'rdp'";
- options = new ConnectionOptions();
- options.Username = myUsername;
- options.Password = myPassword;
- options.Authority = "ntlmdomain:MYDOMAIN";
- scope = new ManagementScope("\\REMOTEMACHINE\root\CIMV2", options);
- scope.Connect();
- searcher = new ManagementObjectSearcher(scope, new ObjectQuery(myQuery));
- myResults = searcher.Get();
- pathPath.Replace("\", "\\");
- pathPath = pathPath.Replace("\", "\\");
Add Comment
Please, Sign In to add comment