Legacy Knowledge Base
Published Jul. 2, 2025

How to create Custom attribute in MS Active Directory and configure in Liferay

Written By

Sivakumar Perumal

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

Issue

  • Is there any way to map a custom attribute in Liferay created from MS Active Directory?

Environment

  • Liferay Portal 6.2

Resolution

  • Liferay provides an OOTB option to achieve the custom attribute mapping.
    #
    # When importing and exporting users, the portal will use this mapping to
    # connect LDAP user attributes and portal user's custom attributes.
    #
    #ldap.user.custom.mappings.0=
    At MS Active Directory side:
    1. Open CMD with “Run as Administrator”.
    2. Type regsvr32 schmmgmt.dll and hit enter
    3. Click Start, click Run, type mmc, and click OK
    4. On the File menu, click Add/Remove Snap-in
    5. Under Available snap-ins, click Active Directory Schema, click Add, and then click OK
    6. Click on Attributes, type Common Name (ex. testcustom) Under syntax select “Unicode String” and Under Unique X500 object ID enter 1.2.840.113.556.1.4.2010, click ok
    7. Click on Classes, select User> Attribute> Add
    8. Select a custom attribute and click ok, then click on Apply and then ok
    9. Click Start> Services and restart “Apache Directory domain services”.
    10. Now, if you are not able to find the custom attribute tab, click on Start> Administrative tools> Active Directory Users and Computers and click on view from the top and select Advance Features. Now you can see the custom attribute in the users properties>Attribute Editor.
    11. Click on your custom attribute and provide the value

     

    At Liferay Side:

    1. Create Custom field (Control panel>Custom fields> Add custom fields) ex. Akash_custom
    2. From UI-> Under custom user mapping  field type Custom field key= custom attribute (ex. akash_custom=testcustom)From portal-ext.properties-> set ldap.user.custom.mappings.0=akash_custom=testcustom

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base