To execute PowerShell to Run As a different credential:
> $cred = Get-Credential
> Start-Process powershell.exe -Credential $cred -NoNewWindow -ArgumentList "-noprofile -command &{Start-Process -FilePath C:\blah\prog.exe}"
Showing posts with label runas. Show all posts
Showing posts with label runas. Show all posts
Thursday, April 19, 2018
Tuesday, May 26, 2009
Run As MSI File
If you need to deploy an MSI file through GPO by using User startup/login script and the MSI needs to have administrator rights, use the following Run As and Sanur:
runas /user:DOMAIN\account-with-admin-rights "msiexec /i The-File.msi /quiet /log c:\the-log.log ALLUSERS=1" | sanur password-for-account-with-admin-rights