Guest User

Untitled

a guest
Jun 12th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. myQuery = "Select * from CIM_DataFile Where Drive = 'C:' AND Path = '\Users\someguy\Documents\' AND FileName = 'Default' AND Extension = 'rdp'";
  2.  
  3. options = new ConnectionOptions();
  4. options.Username = myUsername;
  5. options.Password = myPassword;
  6. options.Authority = "ntlmdomain:MYDOMAIN";
  7. scope = new ManagementScope("\\REMOTEMACHINE\root\CIMV2", options);
  8. scope.Connect();
  9. searcher = new ManagementObjectSearcher(scope, new ObjectQuery(myQuery));
  10. myResults = searcher.Get();
  11.  
  12. pathPath.Replace("\", "\\");
  13.  
  14. pathPath = pathPath.Replace("\", "\\");
Add Comment
Please, Sign In to add comment