Symas OpenLDAP Knowledge Base

Using ldapmodrdn

ldapmodrdn

ldapmodrdn Man Page

Syntax: ldapmodrdn <opts> [-r] [-s <new-superior>] <current DN> <newRDN>

  • The ldapmodrdn command is used to change the RDN of and/or move an entry

ldapmodrdn Examples

# Change the RDN of an entry (and deletes the old RDN)
ldapmodrdn -Q -r "cn=Joly Tham,ou=Payroll,dc=example,dc=com" "cn=Joly Smith" 

# Move an entry to another OU
ldapmodrdn -Q -r -s ou=terminated,dc=example,dc=com "cn=Joly Smith"

# Rename an entry and move it to a new OU
ldapmodrdn -Q -r -s ou=terminated,dc=example,dc=com \
  "cn=Elsa Lytle,ou=Payroll,dc=example,dc=com" "cn=Elsa Biggles"