Last active
December 29, 2016 17:04
-
-
Save leveled/bed601ef948c79e3b6a2773aa765eb29 to your computer and use it in GitHub Desktop.
Use powershell to run an executable file as another user on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$username = 'user' | |
$password = 'password' | |
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force | |
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword | |
Start-Process Notepad.exe -Credential $credential |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment