2011-2012ForgeRock ASldapmodify1OpenDJldapmodifyperform LDAP modify, add, delete, mod DN operationsldapmodifyoptionsDescriptionThis 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).OptionsThe following options are supported.Treat records with no changetype as add operationsUse the LDAP assertion control with the provided filterContinue processing even if there are errorsLDIF file containing the changes to applyUse a request control with the provided informationShow what would be done but do not perform any operationUse the LDAP ReadEntry post-read controlUse the LDAP ReadEntry pre-read controlUse the proxied authorization control with the given authorization
IDLDAP Connection OptionsMaximum length of time (in milliseconds) that can be taken to
establish a connection. Use '0' to specify no time out.Default value: 30000DN to use to bind to the serverDefault value: cn=Directory ManagerUse the authorization identity controlDirectory server hostname or IP addressDefault value: localhost.localdomainBind password file Certificate key store pathNickname of certificate for SSL client authenticationSASL bind optionsDirectory server port numberDefault value: 389Certificate trust store pathUse StartTLS to secure communication with the serverUse the SASL EXTERNAL authentication mechanismCertificate trust store PINCertificate key store PIN fileCertificate trust store PIN fileLDAP protocol version numberDefault value: 3Password to use to bind to the serverCertificate key store PINTrust all server SSL certificatesUse SSL for secure communication with the serverUtility Input/Output OptionsUse the specified character set for command-line inputNo properties file will be used to get default command line
argument valuesPath to the file containing default property values used for
command line argumentsUse verbose modeGeneral OptionsDisplay version informationDisplay usage informationExit Codes0The command completed successfully.ldap-errorAn LDAP error occurred while processing the operation.LDAP result codes are described in RFC
4511. Also see the additional information for details.89An error occurred while parsing the command-line arguments.FilesYou 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=1389ExamplesThe 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=comThe 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=comThe 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=comThe 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