Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $user = "domainservice.account"
  2. $pwd1 = "big long huge string of characters"
  3. $pwd = ($pwd1 | ConvertTo-SecureString)
  4. $Credential = New-Object System.Management.Automation.PSCredential $user, $pwd
  5. $args = "\domain.locallocationlocationlocationScriptscript.ps1"
  6. Start-Process powershell.exe -Credential $Credential -ArgumentList ("-file $args")
  7.  
  8. start powershell -credential ""
  9.  
  10. $username = 'user'
  11. $password = 'password'
  12.  
  13. $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
  14. $credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
  15. Start-Process Notepad.exe -Credential $credential
  16.  
  17. Start-Process powershell.exe -Credential $Credential -Verb RunAs -ArgumentList ("-file $args")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement