HP-UX Directory Server 8.1 administrator guide
The following example adds two telephone numbers to the entry:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: telephonenumber
telephonenumber: 555-1212
telephonenumber: 555-6789
The following example adds two telephonenumber attributes and a manager attribute to the
entry:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: telephonenumber
telephonenumber: 555-1212
telephonenumber: 555-6789
-
add: manager
manager: cn=Sally Nixon,ou=People,dc=example,dc=com
The following example adds a jpeg photograph to the directory. To add this attribute to the
directory, use the -b option, which indicates that ldapmodify should read the referenced file
for binary values if the attribute value begins with a slash:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: jpegphoto
jpegphoto: /path/to/photo
You can also add a jpeg photograph to the directory using the following standard LDIF notation:
jpegphoto: < file:/path/to/photo
Using the standard notation means that the -b option does not need to be used withldapmodify.
However, you must add version:1 to the beginning of the LDIF file or with LDIF update
statements. For example:
ldapmodify -D "cn=directory manager" -w secret -p 389 -h server.example.com
version: 1
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: userCertificate
userCertificate;binary:< file: BarneysCert
NOTE:
Standard LDIF notation can only be used with the ldapmodify command, not with other
command line utilities.
3.4.3.2 Changing an attribute value using LDIF
changetype: modify with the replace operation changes all values of an attribute in an entry.
For example, the following LDIF update statement changes Barney's manager from Sally Nixon
to Wally Hensford:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
replace: manager
manager: cn=Wally Hensford, ou=People, dc=example,dc=com
If the entry has multiple instances of the attribute, then to change one of the attribute values,
you must delete the attribute value first then add the replacement value. For example, this entry
has two telephone numbers:
cn=Barney Fife,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
cn: Barney Fife
sn: Fife
124 Creating directory entries