Beginning ldap – modify a record

Problem

You want to modify an LDAP record.

For example change telephone number, address, etc.



Solution

Use ldapmodify from command line. I might seem daunting to start with, but it is the best way.

Plus you should perform a search with -L option, to take a backup to file.



Example


Here is an example of modifying a record in LDAP, when you need to add an entry to an existing record:


ldapmodify -x -v-D”cn=Manager,dc=demo,dc=net”-w secret<<EOT
dn: cn=jdoe,dc=demo,dc=net
changetype: modify
add: mail
mail: mail: john.doe@demo.net
EOT

Here we are adding the mail field and value.



Reference

[tags]ldapmodify, adding field to ldap record, LDAP Training School[/tags]



Leave a Reply

Your email address will not be published. Required fields are marked *