Answers for "start powershell as different user"

0

start powershell as different user

$user = "domain\service.account" 
$pwd1 = "big long huge string of characters"
$pwd = ($pwd1 | ConvertTo-SecureString)
$Credential = New-Object System.Management.Automation.PSCredential $user, $pwd
$args = "\\domain.local\location\location\location\Script\script.ps1"
Start-Process powershell.exe -Credential $Credential -ArgumentList ("-file $args")
Posted by: Guest on October-15-2021
0

start powershell as different user

start powershell -credential ""
Posted by: Guest on October-15-2021

Code answers related to "start powershell as different user"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language