cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a better way to sync the active directory groups in LDAP queries

hsturner
Champ on-the-rise
Champ on-the-rise
Hi I am trying to find an easier way to sync active directory groups.  We currently have to add the new group name to the LDAP queries and restart the alfresco service to get the new users to synch.  Is there a better way to do this so we don't have to add in the group name and restart the service every time?

I have tried:
ldap.synchronization.groupQuery=(&(objectclass\=group)(memberOf=ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))
ldap.synchronization.groupDifferentialQuery=(&(objectclass\=group)(memberOf=ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))
ldap.synchronization.personQuery=(&(objectclass\=user)(|(memberOf=ou\=Alfresco Groups,ou\=Security_Groups,dc\=pblp,dc\=ca(userAccountControl\:1.2.840.113556.1.4.803\:\=512))

ldap.synchronization.personDifferentialQuery=(&(objectclass\=user)(|(memberOf=ou\=Alfresco Groups,ou\=Security_Groups,dc\=pblp,dc\=ca(userAccountControl\:1.2.840.113556.1.4.803\:\=512))


But I received no group or users synching to alfresco

Here is the current LDAP Queries that do synch groups and users:
ldap.synchronization.groupQuery=(&(objectclass\=group)(memberOf=cn\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))
ldap.synchronization.groupDifferentialQuery=(&(objectclass\=group)(memberOf=CN\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))


ldap.synchronization.personQuery=(&(objectclass\=user)(|(memberOf=cn\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security_Groups,dc\=pblp,dc\=ca)(memberOf=cn\=Alfresco_TAD,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITI,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITS,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_MSG,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_Admin,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_User,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Planning_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Planning_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_FIN,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_HR_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_HR_Manager,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Supervisors,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Techs,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Marketing_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Collaborator, ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Planner_Coordinators,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen_Transfer_Managers, ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen_Transfer_Release,ou\=Alfresco Groups, ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITD,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Consumers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Contributors,ou\=Alfresco Groups, ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_LMS_Manager,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_Site_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_ITD_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_LMS_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_Ops_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))(userAccountControl\:1.2.840.113556.1.4.803\:\=512))

ldap.synchronization.personDifferentialQuery=(&(objectclass\=user)(|(memberOf=cn\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security_Groups,dc\=pblp,dc\=ca)(memberOf=cn\=Alfresco_TAD,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITI,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITS,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_MSG,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_Admin,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ERP_Project_User,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp.dc\=ca)(memberOf=CN\=Alfresco_Game_Planning_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Planning_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_FIN,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_HR_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_HR_Manager,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Supervisors,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Lab_Techs,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Marketing_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Collaborator,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Planner_Coordinators,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen_Transfer_Managers, ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen_Transfer_Release,ou\=Alfresco Groups, ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Game_Gen,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_ITD,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Consumers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Contributors,ou\=Alfresco Groups, ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Business_Development_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_LMS_Manager,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_Site_Managers,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_ITD_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_LMS_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(memberOf=CN\=Alfresco_Second_Chance_Ops_Consumer,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca))(userAccountControl\:1.2.840.113556.1.4.803\:\=512))
1 REPLY 1

hsturner
Champ on-the-rise
Champ on-the-rise
Found using an ldap variable makes this possible.
# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(&(objectClass\=user)(memberof:1.2.840.113556.1.4.1941:\=cn\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(userAccountControl\:1.2.840.113556.1.4.803\:\=512))

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personiDifferentialQuery=(&(objectClass\=user)(memberof:1.2.840.113556.1.4.1941:\=cn\=ERP_Alfresco,ou\=Alfresco Groups,ou\=Security Groups,dc\=pblp,dc\=ca)(userAccountControl\:1.2.840.113556.1.4.803\:\=512)(!(modifyTimeStamp<\={0})))

However I have 1 single user that synchronizes in our development enviroment, but won't in production when using the identical query. Not sure why.  Anyone know what logging property needs to be set to debug so I can see each user being synchronized in the alfresco log. Currently getting message below showing no errors:

2016-07-13 14:20:00,215 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronizing users and groups with user registry 'pbl-ldap-ad1'
2016-07-13 14:20:00,215 WARN  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Full synchronization with user registry 'pbl-ldap-ad1'
2016-07-13 14:20:00,215 WARN  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Some users and groups previously created by synchronization with this user registry may be removed.
2016-07-13 14:20:00,277 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Retrieving groups changed since Jul 8, 2016 9:01:08 AM from user registry 'pbl-ldap-ad1'
2016-07-13 14:20:00,507 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=1 Group Analysis: Commencing batch of 34 entries
2016-07-13 14:20:00,663 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=1 Group Analysis: Processed 34 entries out of 34. 100% complete. Rate: 217 per second. 0 failures detected.
2016-07-13 14:20:00,664 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=1 Group Analysis: Completed batch of 34 entries
2016-07-13 14:20:00,840 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Retrieving users changed since Jul 13, 2016 1:16:36 PM from user registry 'pbl-ldap-ad1'
2016-07-13 14:20:00,909 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=6 User Creation and Association: Commencing batch of 2 entries
2016-07-13 14:20:01,452 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=6 User Creation and Association: Processed 2 entries out of 2. 100% complete. Rate: 3 per second. 0 failures detected.
2016-07-13 14:20:01,452 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=6 User Creation and Association: Completed batch of 2 entries
2016-07-13 14:20:01,454 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=5 User Association: Commencing batch of 1 entries
2016-07-13 14:20:01,456 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=5 User Association: Processed 1 entries out of 1. 100% complete. Rate: 500 per second. 0 failures detected.
2016-07-13 14:20:01,456 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Synchronization,Category=directory,id1=pbl-ldap-ad1,id2=5 User Association: Completed batch of 1 entries
2016-07-13 14:20:01,476 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] Finished synchronizing users and groups with user registry 'pbl-ldap-ad1'
2016-07-13 14:20:01,477 INFO  [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] [DefaultScheduler_Worker-9] 2 user(s) and 34 group(s) processed