다음을 통해 공유


Comma Separated Value Directory Exchange (CSVDE) Utility

CSVDE is a command line utility that allows you to import and export, but not to modify or delete, entries into or from a Lightweight Directory Access Protocol (LDAP) repository, such as Active Directory Application Mode (ADAM), Active Directory Lightweight Directory Services (AD LDS), Active Directory, or Active Directory Domain Services (AD DS). You can see the help for this command line utility by typing csvde /? at a command prompt. Basic command parameters are also listed in the Csvde Help topic in the TechNet Library.

Importing

When using the -i switch, you indicate that you want to import entries from a file into the directory. The file you reference after the -f switch should be a comma separated value file. The first line of the file defines the LDAP object class and attributes that you plan to import from the file.

Exporting

The most basic syntax to cause of CSVDE to export a list of objects in Active Directory to a file named ADObjects.txt on the C: drive is:

csvde -f c:\ADObjects.txt

Note: In Windows Server 2003 R2 or earlier, you would add the -e switch to the command to indicate an export operation. In Windows Server 2008 and later, export is assumed if the -i (import) switch is not part of the command.

You could then open the ADObjects.txt file and review the contents, which would show a large number of objects and attributes. More likely, you would just want to export a subset of information from a subset of your directory. For example, if you want to export just the first name, last name, and email address for all the users in the HQ OU of the contoso.com domain to a file named HQUsersEmail.txt, you run the following command:

csvde -f c:\HQUsersEmail.txt

Similarly, if you wanted to export mail contact records from HQ (not user accounts, just contact records), you could run the following command:

csvde -f c:\HQContactEmail.txt -d "ou=HQ,dc=contoso,dc=com" -r "(objectClass=contact)"

To Specify Attributes

csvde -f c:\HQUsersEmail.csv -l Mail,DN,OrganizationUnit                    

Related articles
Csvde Help
How to Import Mail Contact into Active Directory Using CSVDE
How to use Csvde to import contacts and user objects into Active Directory
Troubleshooting CSVDE import and export
How to use CSVDE.EXE to back up and restore connection agreements
Step-by-Step Guide to Bulk Import and Export to Active Directory
How to set a user's password with LDIFDE
LDAP Properties for CSVDE and VBScript
Using CSVDE dump in Cross forest Move Mailbox in Bulk – Exchange2010 to Exchange 2010