LDIF directives
LDIF format to modify LDAP directories.
Contents |
[edit] General formating
Begin a line with pound sign (#) for comments. The first line in a modifying segment should begin by selecting the DN you want to perform the modification on.
The DN is followed by changetype, a directive and the directive's required parameters (one a line). You could change directives by adding a line with only a dash (-). For example:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify delete: aliases - add: othernames othernames: belmeister
If you want to make modifications on another entry, you could enter a blank line followed by the DN of the new entry.
[edit] changetype: modify
Used to modify attributes of the entry supplied by DN.
[edit] add directive
To add a value to an attribute:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify add: aliases aliases: belminf
If the attribute exists, it will just add the new value(s) to the attribute. You could also include multiple new values like so:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify add: aliases aliases: belminf aliases: bel
And you could replace all the values already set in the attribute by using the replace directive.
[edit] delete directive
To completely delete an attribute:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify delete: aliases
And to delete just a single value of an attribute:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify delete: aliases aliases: belmincito
[edit] replace directive
This will replace all the values set for a directive:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify replace: aliases aliases: belminf
If you want to replace a single value in the attribute, you could use a delete directive and then add directive as shown below:
dn: cn=belmin,ou=users,dc=bfworks,dc=com changetype: modify delete: aliases aliases: belmstr - add: aliases aliases: belmeister

