Agent run powershell script with administrator priviliges


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


Comment actions Permalink

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: 

Comment actions Permalink

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:



Please sign in to leave a comment.