You are here: Foswiki>Sandbox Web>Mediawikicompare (2023-04-19, Foldis)Edit Attach

Adding custom LDAP Attributes to SAMBA4 server

To add a custom LDAP attribute to a user on a SAMBA4 AD-DC server, you need to follow these steps:

  1. Connect to your SAMBA4 AD-DC server using an LDAP client, such as the ldapmodify command-line tool or a GUI LDAP client.
  2. Create a file with the LDIF (LDAP Data Interchange Format) syntax that includes the custom attribute and its value for the user you want to modify. For example, if you want to add a "Department" attribute with the value "Sales" for the user "jdoe", you can create a file named "add_department.ldif" with the following content:
    dn: CN=jdoe,CN=Users,DC=example,DC=com changetype: modify add: department department: Sales
    In this example, CN=jdoe,CN=Users,DC=example,DC=com is the distinguished name (DN) of the user you want to modify, and department is the name of the custom attribute you want to add.
  3. Use the ldapmodify command-line tool to apply the LDIF file to the SAMBA4 AD-DC server. For example, if the LDIF file is located in the current directory, you can run the following command:
    sudo ldapmodify -H ldap://localhost -x -D "CN=Administrator,CN=Users,DC=example,DC=com" -W -f add_department.ldif
    In this example, ldap://localhost is the URL of the LDAP server, CN=Administrator,CN=Users,DC=example,DC=com is the DN of a user with administrative privileges, and -W prompts for the password of the administrative user.
Result:

After running this command, the "Department" attribute with the value "Sales" should be added to the "jdoe" user's LDAP record on the SAMBA4 AD-DC server.

-- SámuelFoldis - 2023-04-19
Topic revision: r1 - 2023-04-19, Foldis
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback