ldapmodrdn

The ldapmodrdn command opens a connection to an LDAP server, binds, and modifies the RDN of entries. The entry information is read from standard input, from file through the use of the -f option, or from the command-line pair dn and rdn.


Syntax

 
ldapmodrdn [ -cnrv ] [ -d debuglevel ] [ -D binddn ] [ -f file ] [ -w passwd ] \
[ -h ldaphost ] [ -p ldapport ] [ dn rdn ]
 

The parameters for this command are:

[ -c ]  

Run in continuous operation mode. Errors are reported, but ldapmodrdn continues with modifications. The default is to exit after reporting an error.  

[ -n ]  

Shows what would be done, but doesn't actually change entries. Useful in conjunction with -v for debugging.  

[ -r ]  

Removes old RDN values from the entry. By default, old values are kept.  

[ -v ]  

Uses verbose mode, with diagnostics written to standard output.  

[ -d debuglevel ]  

Sets the LDAP debugging level. Useful values of debuglevel for ldapmodrdn are:

  • 1 - Trace
  • 2 - Packets
  • 4 - Arguments
  • 32 - Filters
  • 128 - Access control
  • To request more than one category of debugging information, add the masks. For example, to request trace and filter information, specify a debuglevel of 33. See the section entitled "slapdcmd" for a complete list of debugging and trace levels.  

    [ -D binddn ]  

    Uses the distinguished name binddn to bind to the directory.  

    [ -f file ]  

    Reads the entry modification information from file instead of from standard input or the command-line.  

    [ -w passwd ]  

    Uses passwd as the password for authentication to the directory.  

    [ -h ldaphost ]  

    Specifies an alternate host on which the slapd server is running.  

    [ -p ldapport ]  

    Specifies an alternate TCP port where the slapd server is listening.  

    [ dn rdn ]  

    When you specify a dn rdn pair, rdn is a Relative Distinguished Name that replaces the Distinguished Name of the entry specified by dn.  


    Input Format

    If the command-line arguments dn and rdn are given, rdn replaces the RDN of the entry specified by the DN, dn. Otherwise, the contents of file (or standard input if no -f flag is specified) must consist of one or more pair of lines:

      Distinguished Name (DN)
    Relative Distinguished Name (RDN)

    Use one or more blank lines to separate each DN/RDN pair.


    Example

    The file /tmp/entrymods contains:

     
    cn=Modify Me, o=XYZ, c=US
    
     
    cn=The New Me
    
     

    The command:

     
    % ldapmodrdn -r -f /tmp/entrymods
    
     

    changes the RDN of the "Modify Me" entry from "Modify Me" to "The New Me" and the old cn, "Modify Me," is removed.




    Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.