Is there a way to run a powershell script automatically in Elevated mode?
I am trying to automate some post-image tasks without user intervention, but am getting caught with the UAC. Is there a way to "bypass" this, possibly by running as another user?
I want the machine to reboot and run various scripts, so it can complete the build process with no intervention.
Cheers,
Ben
Startup scripts run with elevated privileges. Can you add your script to the Startup scripts in
Computer Configuration
/Windows Settings
/Scripts (startup/Shutdown)
?I'm sure there are other ways to pass credentials but this has worked for me in the past
Here is an example of a self elevating PowerShell script.