Agent run powershell script with administrator priviliges

Answered

My .Net solution requires the powershell script to be run with elevated admin privileges. This is due to using gacutil to register assemblies (unfortunately I can't change this)

The build agent is running under a local user with admin and "log on as a service" rights

Is there anyway to have the agent running the powershell build step to run it as an administrator?

TC 9.1.7

 

2 comments

Hello Jason,

You can use RunAs plugin to run build under specific user.

We have the related request to bundle this feature, please vote for it and watch to get status updates: https://youtrack.jetbrains.com/issue/TW-3171. 

0

 https://youtrack.jetbrains.com/issue/TW-3171

The RunAs plugin allows you to run as a user which is an Admin, but does not allow you to run the process with elevated permissions.

One possible work-around: https://www.tenforums.com/general-support/50444-how-run-ps1-file-administrator.html

 

0

Please sign in to leave a comment.