Chapter 2. Creating Directory Entries
32
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
parameter does not need to be used with
ldapmodify
.
However, you must add
version:1
to the beginning of the LDIF file or with LDIF update statements.
For example:
ldapmodify -D
userDN
-w
user_password
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.
2.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 and then add the replacement value. For example, this entry has two
telephone nubmers:
cn=Barney Fife,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
cn: Barney Fife
sn: Fife
telephonenumber: 555-1212
telephonenumber: 555-6789
To change the telephone number
555-1212
to
555-4321
, use the following LDIF update statement:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
delete: telephonenumber
telephonenumber: 555-1212
-
Summary of Contents for DIRECTORY SERVER 8.0
Page 18: ...xviii ...
Page 29: ...Configuring the Directory Manager 11 6 Enter the new password and confirm it 7 Click Save ...
Page 30: ...12 ...
Page 112: ...94 ...
Page 128: ...110 ...
Page 190: ...Chapter 6 Managing Access Control 172 4 Click New to open the Access Control Editor ...
Page 224: ...206 ...
Page 324: ...306 ...
Page 334: ...316 ...
Page 358: ...340 ...
Page 410: ...392 ...
Page 420: ...402 ...
Page 444: ...426 ...
Page 454: ...436 ...
Page 464: ...446 ...
Page 484: ...466 ...
Page 512: ...494 ...
Page 522: ...504 ...