Content record format
Each content record is represented as a group of attributes, with records separated from one another by blank lines. The individual attributes of a record are represented as single logical lines (represented as one or more multiple physical lines via a line-folding mechanism), comprising "name: value" pairs. Value data that do not fit within a portable subset of ASCII characters are marked with '::' after the attribute name and encoded into ASCII using base64 encoding. The content record format is a subset of the Internet Directory Information typTools that employ LDIF
The OpenLDAP utilities include tools for exporting data from LDAP servers to LDIF content records (), importing data from LDIF content records to LDAP servers (), and applying LDIF change records to LDAP servers (). LDIF is one of the formats for importing and exporting address book data that the address books in Netscape Communicator and in the Mozilla Application Suite support. Microsoft Windows 2000 Server and Windows Server 2003 include an LDIF based command line tool named LDIFDE for importing and exporting information in Active Directory. JXplorer is a cross platform open source java application that can browse and do basic editing of LDIF files.LDIF fields
; dn: distinguished name :This refers to the name that uniquely identifies an entry in the directory. ; dc: domain component :This refers to each component of the domain. For example www.mydomain.com would be written as DC=www,DC=mydomain,DC=com ; ou: organizational unit :This refers to the organizational unit (or sometimes the user group) that the user is part of. If the user is part of more than one group, you may specify as such, e.g., OU= Lawyer,OU= Judge. ; cn: common name :This refers to the individual object (person's name; meeting room; recipe name; job title; etc.) for whom/which you are querying.Examples of LDIF
This is an example of a simple directory entry with several attributes, represented as a record in LDIF:dn: cn=The Postmaster,dc=example,dc=com objectClass: organizationalRole cn: The PostmasterThis is an example of an LDIF record that modifies multiple single-valued attributes for two different directory entries (this format is used by Microsoft's LDIFDE tool):
dn: CN=John Smith,OU=Legal,DC=example,DC=com changetype: modify replace: employeeID employeeID: 1234 - replace: employeeNumber employeeNumber: 98722 - replace: extensionAttribute6 extensionAttribute6: JSmith98 - dn: CN=Jane Smith,OU=Accounting,DC=example,DC=com changetype: modify replace: employeeID employeeID: 5678 - replace: employeeNumber employeeNumber: 76543 - replace: extensionAttribute6 extensionAttribute6: JSmith14 -Note: the "-" character between each attribute change is required. Also note that each directory entry ends with a "-" followed by a blank line. The final "-" is required by Microsoft's LDIFDE tool, but not needed by most ldif implementations. This is an example of an LDIF file that adds a telephone number to an existing user:
dn: cn=Peter Michaels, ou=Artists, l=San Francisco, c=US changetype: modify add: telephonenumber telephonenumber: +1 415 555 0002An example of LDIF containing a control:
version: 1 dn: o=testing,dc=example,dc=com control: 1.3.6.1.1.13.1 false cn changetype: add objectClass: top objectClass: organization o: testing
RFCs
* — The LDAP Data Interchange Format (LDIF) - Technical Specification * — Lightweight Directory Access Protocol (LDAP): Technical Specification Road Map * {{IETF RFC, 4525, link=no — LDAP Modify-Increment ExtensionExternal links