1

I have configured TeamCity (8.1.4) for LDAP logins and it works as advertised including synchronization of displayname and email. But I have a problem with synchronization of VCS properties.

New users are being created (when they first log in) without their display name or email address being populated. This is remedied when the sync happens, so I know the sync works for those properties. I need the "Default for all of VCS roots" property filled out properly as well though. This is required so that people can be matched to their check-ins (it's not happening at the moment) so they can be emailed when they break the tests.

The "Default for all of VCS roots" property is simply being populated as username, but I need it to be DOMAIN\username.

My settings:

    java.naming.provider.url=ldap://my.domaincontroller.com:389/DC=mydomain,DC=local
    java.naming.security.principal=monkey
    java.naming.security.credentials=bubbles
    teamcity.users.base=OU=group2,OU=Users
    teamcity.users.login.filter=(sAMAccountName=$capturedLogin$)
    teamcity.users.username=sAMAccountName
    teamcity.auth.loginFilter=.*
    teamcity.options.users.synchronize=true
    teamcity.users.filter=(objectClass=user)
    teamcity.options.groups.synchronize=false
    teamcity.options.createUsers=false
    teamcity.options.deleteUsers=false
    teamcity.options.syncTimeout = 3600000
    teamcity.groups.property.member=member
    teamcity.users.property.displayName=displayName
    teamcity.users.property.email=mail
    teamcity.users.property.plugin\:vcs\:anyVcs:anyVcsRoot=mydomain\\$sAMAccountName$
CarllDev
  • 1,294
  • 2
  • 19
  • 34
  • Did you get this working? What were your settings? – mcintyre321 Sep 23 '15 at 09:55
  • 1
    I don't think Teamcity has this capability out of the box. In the end I had to resort to using some powershell scripting to populate the required fields. Have left the place so don't have access to the scripts, I'm afraid. – CarllDev Sep 25 '15 at 12:48
  • Thanks. I got it working, sorta. I ended up doing a force sync to create users, instead of auto create. It seems my LDAP didn't have the mail property either, probably coz we're on gmail not exchange. – mcintyre321 Sep 28 '15 at 16:33

1 Answers1

0

You can play around with the settings for LDAP to achieve this but we ran into some issues when we set this up on our projects. We had more than one type of VCS repo and when we started to move to Git, our repository just did not store usernames in DOMAIN//username syntax.

A better way would be to update the user tables in teamcity database to set the default userid for all TFS based roots to DOMAIn/username. This is the syntax

insert into user_property
values(<user_id>,'plugin:vcs:jetbrains.**tfs**:anyVcsRoot','DOMAIN//username')
Biswajit_86
  • 3,661
  • 2
  • 22
  • 36