2011-2012ForgeRock AS ldapmodify1 OpenDJ ldapmodify perform LDAP modify, add, delete, mod DN operations ldapmodify options Description This utility can be used to perform LDAP modify, add, delete, and modify DN operations in the directory. When not using a file to specify modifications, end your input with EOF (Ctrl+D on UNIX, Ctrl+Z on Windows). Options The following options are supported. Treat records with no changetype as add operations Use the LDAP assertion control with the provided filter Continue processing even if there are errors LDIF file containing the changes to apply Use a request control with the provided information Show what would be done but do not perform any operation Use the LDAP ReadEntry post-read control Use the LDAP ReadEntry pre-read control Use the proxied authorization control with the given authorization ID LDAP Connection Options Maximum length of time (in milliseconds) that can be taken to establish a connection. Use '0' to specify no time out. Default value: 30000 DN to use to bind to the server Default value: cn=Directory Manager Use the authorization identity control Directory server hostname or IP address Default value: localhost.localdomain Bind password file Certificate key store path Nickname of certificate for SSL client authentication SASL bind options Directory server port number Default value: 389 Certificate trust store path Use StartTLS to secure communication with the server Use the SASL EXTERNAL authentication mechanism Certificate trust store PIN Certificate key store PIN file Certificate trust store PIN file LDAP protocol version number Default value: 3 Password to use to bind to the server Certificate key store PIN Trust all server SSL certificates Use SSL for secure communication with the server Utility Input/Output Options Use the specified character set for command-line input No properties file will be used to get default command line argument values Path to the file containing default property values used for command line arguments Use verbose mode General Options Display version information Display usage information Exit Codes 0 The command completed successfully. ldap-error An LDAP error occurred while processing the operation. LDAP result codes are described in RFC 4511. Also see the additional information for details. 89 An error occurred while parsing the command-line arguments. Files You can use ~/.opendj/tools.properties to set the defaults for bind DN, host name, and port number as in the following example. hostname=directory.example.com port=1389 bindDN=uid=kvaughan,ou=People,dc=example,dc=com ldapcompare.port=1389 ldapdelete.port=1389 ldapmodify.port=1389 ldappasswordmodify.port=1389 ldapsearch.port=1389 Examples The following example demonstrates use of the command to add an entry to the directory. $ cat newuser.ldif dn: uid=newuser,ou=People,dc=example,dc=com uid: newuser facsimileTelephoneNumber: +1 408 555 1213 objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: posixAccount objectClass: top givenName: New cn: New User cn: Real Name telephoneNumber: +1 408 555 1212 sn: Jensen roomNumber: 1234 homeDirectory: /home/newuser uidNumber: 10389 mail: newuser@example.com l: South Pole ou: Product Development ou: People gidNumber: 10636 $ ldapmodify -p 1389 -a -f newuser.ldif -D uid=kvaughan,ou=people,dc=example,dc=com -w bribery Processing ADD request for uid=newuser,ou=People,dc=example,dc=com ADD operation successful for DN uid=newuser,ou=People,dc=example,dc=com The following example demonstrates adding a Description attribute to the new user's entry. $ cat newdesc.ldif dn: uid=newuser,ou=People,dc=example,dc=com changetype: modify add: description description: A new user's entry $ ldapmodify -p 1389 -f newdesc.ldif -D uid=kvaughan,ou=people,dc=example,dc=com -w bribery Processing MODIFY request for uid=newuser,ou=People,dc=example,dc=com MODIFY operation successful for DN uid=newuser,ou=People,dc=example,dc=com The following example demonstrates changing the Description attribute for the new user's entry. $ cat moddesc.ldif dn: uid=newuser,ou=People,dc=example,dc=com changetype: modify replace: description description: Another description $ ldapmodify -p 1389 -f moddesc.ldif -D uid=kvaughan,ou=people,dc=example,dc=com -w bribery Processing MODIFY request for uid=newuser,ou=People,dc=example,dc=com MODIFY operation successful for DN uid=newuser,ou=People,dc=example,dc=com The following example demonstrates deleting the new user's entry. $ cat deluser.ldif dn: uid=newuser,ou=People,dc=example,dc=com changetype: delete $ ldapmodify -p 1389 -f deluser.ldif -D uid=kvaughan,ou=people,dc=example,dc=com -w bribery Processing DELETE request for uid=newuser,ou=People,dc=example,dc=com DELETE operation successful for DN uid=newuser,ou=People,dc=example,dc=com