Deleting LDAP Record

Problem

You want to delete a LDAP entry.



Solution

In this example, we just use ldapdelete from the command line.

Remember to take a backup. ldapsearch with -L



Example


Here is an example of deleting a record in LDAP:


ldapdelete -v -D'cn=Manager..' -w ${passwd}
-h ${host} -p ${port}<<EOT
cn=….
EOT

Effectively – you just need to supply the full DN. Also be aware you need to delete the lowest branch first, for example:

uid=….
sales=…,uid=….

You need to delete sales first, then uid.



Reference

[tags]ldapdelete, LDAP Training School[/tags]



Leave a Reply

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