Legacy Knowledge Base
Published Sep. 10, 2025

Import and authenticate users from a particular group in Active Directory

Written By

Emma Liu

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Instead of importing and authenticating all users from Microsoft Active Directory (AD), I would like to only import and authenticate users from a particular group in AD.

Environment

  • Liferay DXP 7.3

Resolution

  1. In the Authentication Search Filter, specify the filter like this:
    (&(objectCategory=person)(mail=@email_address@)(memberOf=cn=$Group_name,dc=mydomain,dc=com))

    For multiple groups, the filter is like this:
    (&(objectCategory=person)(|(memberOf=cn=$Group1_name,dc=mydomain,dc=com)(memberOf=cn=$Group2_name,dc=mydomain,dc=com)))
  2. In the Groups > Import Search Filter, specify the filter like this:
    (&(objectClass=person)(memberOf=cn=$Group_name,dc=mydomain,dc=com))

    For multiple groups, change the search filter like this:
    (&(objectClass=person)(|(memberOf=cn=$Group1_name,dc=mydomain,dc=com)(memberOf=cn=$Group2_name,dc=mydomain,dc=com)))

 

Additional Information

  • "$Group_name", "$Group1_name", "$Group2_name", should be changed to the group name in AD.
  • If the group name contains a special character (e.g. #), the special character should be escaped with "\\" in the Authentication Search Filter like this:
    (&(sAMAccountName=@screen_name@)(|(memberOf=cn=\\#group1,ou=groupTest,dc=mydomain,dc=com)(memberOf=cn=\\#group2,ou=groupTest,dc=mydomain,dc=com)))
  • When clicking 'Test LDAP Users', only users with defined security group/s will be listed.
  • Wildcards are not supported for memberof attributes. Details can be found here.
Did this article resolve your issue ?

Legacy Knowledge Base