53

I am trying to get a build process set up in TeamCity 5, and I am encountering an access denied error when trying to copy some files. I see that my build agent is running as "SYSTEM" now, and I think that's part of the problem. I'd like to change that user identity. The trouble is that I can't figure out how to change those settings on the build agent. How can I change the build user identity?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Chris Farmer
  • 24,974
  • 34
  • 121
  • 164

1 Answers1

68
  1. Open the services list (Start -> Run -> services.msc)
  2. Find the "Team City Build Agent" service
  3. Open the properties dialog for the service (right click, Properties)
  4. Choose the "Log On" tab
  5. Change the identity of the user running the service by choosing "this account" and enter the password.
Matt
  • 74,352
  • 26
  • 153
  • 180
Otávio Décio
  • 73,752
  • 17
  • 161
  • 228
  • 7
    I've done this and `user.name` still shows up as `SYSTEM`, even though the `user.home` points to the correct path. Is this expected? Is there some sort of refreshing I have to do? – Merlyn Morgan-Graham Oct 06 '11 at 01:34
  • I have the same problem. Anyone with a solution? – Niklas J. MacDowall Feb 09 '12 at 10:39
  • Open the properties dialog for the service - what does this mean? How do you find the service to open the properties dialog? – Luke Mcneice Jul 23 '12 at 17:11
  • I've done this in version 8.1, and the `USERNAME` env var is showing up as `SERVERNAME$`. – brianary Nov 11 '14 at 01:31
  • 3
    From [Known Issues: Agent Running As Windows Service Limitations - TeamCity 8.x Documentation - Confluence](http://confluence.jetbrains.com/display/TCD8/Known+Issues#KnownIssues-AgentrunningasWindowsServiceLimitations): "As a Windows service, the TeamCity agent and the build processes are not able to access network shares and mapped drives." (Not sure how other CI engines such as Jenkins and TFS are able to, then.) – brianary Nov 11 '14 at 23:39
  • @MerlynMorgan-Graham Did you restart the build agent service? That's what I had to do. – sirdank Aug 18 '15 at 18:59
  • 1
    @sirdank - Hard to remember. Was 4 years ago ;) – Merlyn Morgan-Graham Aug 19 '15 at 02:41
  • 1
    @MerlynMorgan-Graham Oops! Well maybe it will help someone. – sirdank Aug 19 '15 at 12:14