Requests for Automation

Run powershell as Admin

Just would like to be able execute Powershell scripts as administrator.

This request was archived: Available in Product

Gravatar for Douglas Sanchez
Douglas Sanchez over 3 years ago

I have been able to run scripts as admin using the executePowershellCommand64BitsSystem function. You also need to take in consideration that the script needs to be built to bypass any prompt, using the -force arguments when needed or -credentials as some scripts are still harder to execute than others.

Gravatar for Roy Herron
Roy Herron about 3 years ago

You can also run as System and that should work so long as you have admin credentials set on the machine.

Gravatar for Jay Jansen
Jay Jansen almost 3 years ago

Also worth noting if you bind and agent credential then call UseCredential before your next steps then anything execuded as "user" would use the creds bound to the agent thus elevating if they have proper access. More often than not I just run it as system just be sure to either add the -force command or if you are using shell then powershell.exe -executionpolicy bypass -file C:\path\to\script.ps1


  • Request Archived
  • 4 Votes
  • Open for over 3 years
  • Created by Jerrell Evans