Advertisement
Guest User

Untitled

a guest
Jul 11th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. options.Impersonation = ImpersonationLevel.Impersonate;
  2. options.Authentication = AuthenticationLevel.Default;
  3. options.Username = userName;
  4. options.Password = password;
  5. options.Authority = null;
  6. options.EnablePrivileges = true;
  7. ManagementScope scope = new ManagementScope(path, options);
  8. scope.Connect();
  9.  
  10. // Create the process
  11. using (ManagementClass process = new ManagementClass("Win32_Process"))
  12. {
  13. ConnectionOptions conn = new ConnectionOptions();
  14.  
  15. conn.Username = "support";
  16. conn.Password = "password";
  17. process.Scope = scope;
  18. process.InvokeMethod("Create", commandLine);
  19. ManagementScope ms = new ManagementScope(@"\10.64.4.38rootcimv2", conn);
  20. Process g = Process.Start(@"C:\Program FilesRealVNCVNC Viewervncviewer.exe");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement