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

Discussion
Gravatar for Jay Jansen
Jay Jansen 10 months 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

Gravatar for Roy Herron
Roy Herron about 1 year ago

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

Gravatar for Douglas Sanchez
Douglas Sanchez over 1 year 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.

Details

  • Request Archived
  • 4 Votes
  • 3 Comments
  • Open for over 1 year
  • Created by Jerrell Evans