CSVDE is a command-line tool that imports or exports Active Directory objects from or to a comma-delimited text file (also known as a comma-separated value text file, or .csv file). Comma-delimited files can be created, modified, and opened with tools as familiar as Notepad and Microsoft Office Excel. If you have user information in existing Excel or Microsoft Office Access databases, you will find that CSVDE is a powerful way to take advantage of that information to automate user account creation.
The basic syntax of the CSVDE command for export is:
csvde -f filename
However, that command will export all objects in your Active Directory domain. You will want to limit the scope of the export, which you can do with the following four parameters:
1) -d RootDN Specifies the distinguished name of the container from which the export
will begin. The default is the domain itself.
2) -p SearchScope Specifies the scope of the search relative to the container specified
by -d. SearchScope can be either base (this object only), onelevel (objects within this
container), or subtree (this container and all subcontainers). The default is subtree.
3) -r Filter Filters the objects returned within the scope configured by -d and -p. Filter is a Lightweight Directory Access Protocol (LDAP) query syntax. You will work with a filter in the practice for this lesson. LDAP query syntax is beyond the scope of this course.
See http://technet.microsoft.com/en-us/library/aa996205(EXCHG.65).aspx for more
4) -l ListOfAttributes Specifies the attributes that will be exported. Use the LDAP name
for each attribute, separated by a comma, as in -l DN,objectClass,sAMAccountName,sn, givenName,userPrincipalName.
The output of a CSVDE export lists the selected, exported LDAP attribute names on
the first line. Each object follows, one per line. Here’s a sample file:
“CN=David Jones,OU=User Accounts,DC=contoso,DC=com”,user,Jones,David,david.jones,
“CN=Lisa Andrews,OU=User Accounts,DC=contoso,DC=com”,user,Andrews,Lisa,lisa.andrews,