1.2. Getting Familiar with LDIF
Even with the new utilities available with Windows
Server 2003, support for modifying data within Active Directory using
a command-line tool is relatively weak. The dsmod
tool can modify attributes on a limited set of object classes, but it
does not allow you to modify any object type.
One reason for the lack of command-line tools to do this is the command line is not well suited for manipulating objects, for example, that have multivalued attributes. If you want to specify more than just one or two values, a single command could get quite long. It would be easier to use a GUI editor, such as ADSI Edit, to do the task instead.
The LDAP Data Interchange Format was designed to address this issue. Defined in RFC 2849, LDIF allows you to represent directory additions, modifications, and deletions in a text-based file, which you can import into a directory using an LDIF-capable tool.
The ldifde
utility has been available since
Windows 2000 and it allows you to import and export Active Directory
content in LDIF format. LDIF files are composed of blocks of entries.
An entry can add, modify, or delete an object. The first line of an
entry is the distinguished name. The second line contains a
changetype, which can be add,
modify, or delete. If it is an object addition, the rest of the entry contains the attributes that should be initially set on the object (one per line). For object deletions, you do not need to specify any other attributes. And for object ...