Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

start-process with different user credentials as system user getting access denied

$
0
0
I am trying to launch a powershell script as a different users by using start-process while running as the system account. Any ideas how I can get around this. param($ID) Set-ExecutionPolicy Unrestricted $username = 'Blah' $password = 'blahblah' $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force)) start-process -FilePath C:\scomscripts\ack_scom_alert.cmd -argumentlist $ID -Credential $cred -wait -passthru

Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>