How to Import Mail Contact into Active Directory Using CSVDE

How to Import Mail Contact into Active Directory Using CSVDE

To add contact records to Active Directory using CSVDE, you need only define the Lightweight Directory Access Protocol (LDAP) location in the directory where you want to place the contact (DN), object class (objectClass), and email (mail) address for each entry. For example, assume that you have the following file named NewContacts.csv. The contents of the NewContacts.csv file in the C:\Users folder has the following three lines:

DN,objectClass,mail
"CN=Ben Smith,OU=HQ,DC=contoso,DC=com",contact,BSmith@cpandl.com
"CN=Brian Smith,OU=HQ,DC=contoso,DC=com,contact,BrianSmith@cpandl.com

After running the command csvde -i -f c:\Users\NewContacts.csv you would see output similar to:
Connecting to "(null)"
Logging in as current user using SSPI
Importing directory from file "NewContacts.csv"
Loading entries...
2 entries modified successfully.
The command has completed successfully

Then you could go verify that your contact records were added by using an LDAP tool, like LDP.EXE or ADSIEDIT.EXE or just Active Directory Users and Computers (dsa.msc) as shown in the following figure.



Related information
Comma Separated Value Directory Exchange (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

This article was inspired by the Directory Services forum post  Import mail contact into Active Directory using CSVDE
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Command line actually needs to be csvde -i -f c:\Users\NewContacts.csv  - with no switches it exports by default.

Page 1 of 1 (1 items)