Skip to content

How to use

Nikolay Pianikov edited this page Dec 12, 2016 · 88 revisions

All you need to do is:

  • add the "RunAs" TeamCity Build Feature or use the advanced options "Run as" of any build step
  • specify the user name for RunAsUser. For Windows the following formats are acceptable: username or username@domain or domain\username
  • specify the password

For example

That's it! Once the build is run, the plugin runs all commands under the specified Windows user account.

Implicit mode

Sometimes there is a case when all build steps on a TeamCity agent should be runned under the specific user account. To use this scenario you should:

  • Disable UI extensions for runAs plugin via TeamCity server parameters. For example using the -Dteamcity.runas.ui.enabled=false command line argument

  • Configure runAs tool settings using the TeamCity configuration parameters or in the file buildAgent\conf\buildAgent.properties for each build agent: run_as_user - for user name, secure:run_as_password - for password and run_as_additional_args - for additional command line arguments for runAs tool. For example the file c:\buildAgent\conf\buildAgent.properties may contain the following additional lines:

run_as_user=MyUser

secure\:run_as_password=MyPassword

Clone this wiki locally