Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Updated: December 30, 2008

Applies To: Windows Server 2008, Windows Server 2008 R2, Windows Server 2012


Imports and exports data from Active Directory Lightweight Directory Services (AD LDS) using files that store data in the comma-separated value (CSV) format. You can also support batch operations based on the CSV file format standard.


csvde [ -i ] [ -f   FileName ] [ -s   ServerName ] [ -c   String1 String2 ] [ -v ] [ -j   Path ] [ -t   PortNumber ] [ -d   BaseDN ] [ -r   LDAPFilter ] [ -p   Scope ] [ -l   LDAPAttributeList ] [ -o   LDAPAttributeList ] [ -g ] [ -m ] [ -n ] [ -k ] [ -a   UserDistinguishedName Password ] [ -b   UserName Domain Password ]


Specifies the import mode. If the import mode is not specified, the default mode is export.

-f FileName
Identifies the import or export file name.

-s ServerName
Specifies the domain controller to perform the import or export operation.

-c String1 String2
Replaces all occurrences of String1 with String2 . You generally use this when you importing from one domain to another and the distinguished name of the export domain ( String1 ) must be replaced with the distinguished name of the import domain ( String2 ).

Sets verbose mode.

-j Path
Sets the log file location. The default is the current path.

-t PortNumber
Specifies a Lightweight Directory Access Protocol (LDAP) port number. The default LDAP port is 389. The global catalog port is 3268.

-d BaseDN
Sets the distinguished name of the search base for data export.

-r LDAPFilter
Creates an LDAP search filter for data export.

-p Scope
Sets the search scope. Search scope options are Base , OneLevel , or SubTree .

-l LDAPAttributeList
Sets the list of attributes to appear in the results of an export query. If this parameter is omitted, all attributes are returned.

-o LDAPAttributeList
Sets the list of attributes to be omitted from the results of an export query. You typically use this when you export objects from Active Directory Domain Services (AD DS) and then import them into another LDAP-compliant directory. If the attributes are not supported by another directory, you can omit the attributes from the result set using this option.

Omits paged searches.

Omits attributes that cannot be written, such as the ObjectGUID and objectSID attributes.

Omits export of binary values.

Ignores errors during the import operation, and continues processing. The following is a complete list of ignored errors:

  • Object already exists.

  • Constraint violation.

  • Attribute or value already exists.

-a UserDistinguishedName Password
Sets the command to run using the supplied UserDistinguishedName and Password . By default, the command runs using the credentials of the user who is currently logged on to the network.

-b UserName Domain Password
Sets the command to run as UserName Domain Password . By default, the command will run using the credentials of the user who is currently logged on to the network.

Displays the command menu.


  • Applications such as Microsoft Excel are capable of reading and saving data in the CSV format. In addition, Microsoft Exchange Server administration tools are also capable of importing and exporting data using the CSV format, as are many other non-Microsoft tools.

    The CSV format consists of one or more lines of data, with each value separated by a comma. The first line (sometimes referred to as the header) of the CSV file must contain the names of each attribute in the same order as the data in any line following the first line.





  • You can use csvde -r to create an LDAP search filter for data export. For example, the following filter exports all users with a particular surname:

    csvde -r (and(objectClass=User)(sn=SurName))

Formatting legend


Format Meaning


Information that you supply


Elements that you type exactly as shown

Ellipsis (...)

A parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

A set of choices from which you must choose only one

Courier font

Code or program output

Additional references

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft