Answers for "windows execute powershell script define user"

0

windows execute powershell script define user

$username = "DOMAIN\User"
$password = "Password"
$secstr = New-Object -TypeName System.Security.SecureString
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
Invoke-Command -FilePath "C:\Script\To\Execute.ps1" -Credential $cred -Computer localhost
Posted by: Guest on November-16-2020

Code answers related to "windows execute powershell script define user"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language