You want to export objects to an LDAP Data Interchange Format (LDIF) file.
220.127.116.11 Using a graphical user interface
None of the standard Microsoft tools support exporting LDIF from a GUI.
18.104.22.168 Using a command-line interface
> ldifde -f output.ldf -l <AttrList> -p <Scope> -r "<Filter>" -d "<BaseDN>"
22.214.171.124 Using VBScript
There are no COM or VBScript-based interfaces to LDIF. With Perl you can use the Net::LDAP::LDIF module, which supports reading and writing LDIF files.
The LDIF specification defined in RFC 2849 describes a well-defined file-based format for representing directory entries. The format is intended to be both human and machine parseable, which adds to its usefulness. LDIF is the de facto standard for importing and exporting a large number of objects in a directory and is supported by virtually every directory vendor including Microsoft.
126.96.36.199 Using a command-line interface
The -f switch specifies the name of the file to use to save the entries to, -s is the DC to query, -l is the comma-separated list of attributes to include, -p is the search scope, -r is the search filter, and -d is the base DN. If you encounter any problems using ldifde, the -v switch enables verbose mode and can help identify problems.
4.24.4 See Also
Recipe 4.25 for importing objects using LDIF, RFC 2849 (The LDAP Data Interchange Format (LDIF) Technical Specification), and MS KB 237677 (Using LDIFDE to Import and Export Directory Objects to Active Directory)