-
Notifications
You must be signed in to change notification settings - Fork 14
How to use
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
That's it! Once the build is run, the plugin runs all the commands under the specified Windows user account.
For agents under Windows it is possible to specify the Windows Integrity Level, the logging level, and additional arguments.
There may be a case when all build steps on a TeamCity agent should be run under a specific user account by default. To do that
-
Disable the UI extensions for the runAs plugin, if needed, via the TeamCity server parameters. For example, using the
-Dteamcity.runAs.ui.enabled=false
command-line argument -
Configure the runAs tool settings using the TeamCity configuration parameters or in the file
buildAgent\conf\buildAgent.properties
for each build agent:
-
teamcity.runAs.username - for user name, teamcity.runAs.password - for password, and -
teamcity.runAs.additionalCommandLine - for additional command line arguments for the runAs tool.
For example, the file
c:\buildAgent\conf\buildAgent.properties
may contain the following additional lines:
teamcity.runAs.username=MyUser
teamcity.runAs.password=MyPassword