LDAP Shell Commands :: ldapmodify
Ldapmodify opens a connection to an
LDAP server, binds and modifies entries with information read from a file (-f option) or from the standard input.
| ldapmodify |
[-a] [-c] [-S file] [-n] [-v] [-k]
[-K] [-M[M]] [-d debuglevel] [-D binddn]
[-W] [-w passwd] [-y passwdfile] [-H ldapuri]
[-h ldaphost] [-p ldapport] [-P 2|3]
[-O security-properties] [-I] [-Q]
[-U authcid] [-R realm] [-x]
[-X authzid] [-Y mech] [-Z[Z]] [-f file]
|
| -c |
Continuous operation mode. If an error is found when an entry is being modified, it is reported, but ldapmodify will continue. |
|
-h ldaphost |
Specifies an alternate host on which the LDAP server is running |
| -p ldapport |
Specifies the TCP port where LDAP server is listening |
| -D binddn |
Binddn is the distinguished name used to bind to the LDAP server |
| -w passwd |
Use passwd as the password for simple authentication |
| -f file |
Read the modification information from file. |
The following command:
ldapmodify -c -h 10.63.3.200 -p 1389
-D "cn=SalesManager, ou=people,dc=mycompany,dc=com"
-w abc123 -f /tmp/Modifies.info
will try to apply modifications described in "/tmp/Modifies.info" file in the LDAP server in host 10.63.3.200 listening on port 1389 binding as "cn=SalesManager...".
If the contents of "/tmp/Modifies.info" are:
dn: did=2002090100004,ou=products,dc=mycompany,dc=com
changetype: modify
replace: price
price: 500
-
delete: memorySize
-
add: provider
provider: IBM
dn: did=2003051000004,ou=products,dc=mycompany,dc=com
changetype: delete
Two entries in the LDAP server are modified. The second one is deleted, and the first one has its memorySize attribute removed, its price attribute changed to 500 and a new attribute called provider added with "IBM" as value.
Errors modifying an entry result in a non-zero exit status and a diagnostic message being written to standard error.