ldapdelete

The ldapdelete command opens a connection to an LDAP server, binds, and deletes one or more entries. If one or more dn arguments are provided, entries with those distinguished names are deleted. If no dn arguments are provided, a list of DNs is read from file, if the -f flag is specified, or from standard input.


Syntax

 
ldapdelete [ -c ] [ -n ] [ -v ] [ -d debuglevel ] [ -D binddn ] [ -f file ] [ -w passwd ]\ 
[ -h ldaphost ] [ -p ldapport ] [ dn... ]
 

The parameters for this command are:

[ -c ]  

Specifies continuous operation mode. Errors are reported, but ldapdelete continues with deletions. The default is to exit after reporting an error.  

[ -n ]  

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

[ -v ]  

Uses verbose mode, with diagnostics written to standard output.  

[ -d debuglevel ]  

Sets the LDAP debugging level. Useful levels of debugging for ldapmodify and ldapadd 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 debug level 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 deletion information from file instead of from standard input.  

    [ -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...]  

    Specifies one or several distinguished names of entries to delete.  


    Example

    To delete the entry named with the common name (cn) Delete Me directly below the XYZ Corporation organizational entry, use following command:

     
    % ldapdelete -D "cn=Administrator, o=XYZ, c=US" -w password \ 
    
     
    "cn=Delete Me, o=XYZ, c=US"
    
     




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