The most common problem when importing data using CSVDE into an LDAP repository (Active Directory, AD DS, AD LDS, ADAM, or others) are typos in the source file.
Csvde does not log events to the Application event log.
To troubleshoot Csvde you must view the command line output and use LDP or ADSI Edit to compare your file with the attributes of existing user objects. Do not modify objects in Active Directory without first testing the process extensively in a lab environment.
Csvde does give indications of what is not acceptable in your .csv file for import operations.
For example:
If you try, you will see an error message similar to the following:
C:\Users\DAdmin>csvde -i -f importusers.csv Connecting to "(null)" Logging in as current user using SSPI Importing directory from file "importusers.csv" Loading entries. Add error on line 2: Already Exists The server side error is "An attempt was made to add an object to the directory with a name that is already in use." 0 entries modified successfully. An error has occurred in the program.
Connecting to "(null)"
Logging in as current user using SSPI Importing directory from file "importusers.csv"
Loading entries.
Add error on line 2: Already Exists
The server side error is "An attempt was made to add an object to the directory with a name that is already in use."
0 entries modified successfully.
An error has occurred in the program.
If a required attribute is missing from your .csv file, you receive the following message:
C:\Users\DAdmin>csvde -i -f importusers.csv Connecting to "(null)" Logging in as current user using SSPI Importing directory from file "importusers.csv" Loading entries. Add error on line 2: Constraint Violation The server side error is "A required attribute is missing." 0 entries modified successfully. An error has occurred in the program.
C:\Users\DAdmin>csvde -i -f importusers.csv Connecting to "(null)" Logging in as current user using SSPI Importing directory from file "importusers.csv" Loading entries. Add error on line 2: Constraint Violation The server side error is "A required attribute is missing." 0 entries modified successfully.
Loading entries. Add error on line 2: Constraint Violation
The server side error is "A required attribute is missing."
Some specific items to check when troubleshooting CSVDE import operations include.
DN,objectClass,sAMAccountName,givenName,sn,userPrincipalName The Distinguished Name (DN) portion would be surrounded in quotation marks, as in: "cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,jeff.hey@cpandl.com Also, if you are trying to place a comma within an entry, you can double quote it. Just realize that you only want to do that is really want you want to do. For example, if you want the displayName for Jeff Hey to be Hey,Jeff, then you would enter the following first line: DN,objectClass,sAMAccountName,givenName,sn,displayName,userPrincipalName Then, you would include a field for each value you wanted to define: "cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,"Hey,Jeff",jeff.hey@cpandl.com Further, if you wanted to omit an entry that is defined, you must still represent that field if it is in the definition line. For example, say you use the same definition line as above: DN,objectClass,sAMAccountName,givenName,sn,displayName,userPrincipalName But you do not want to include a displayName for Jeff Hey. Then you would have the following line as an entry for Jeff Hey's account: "cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,,jeff.hey@cpandl.com Effectively the two back-to-back commas are indicating that the displayName, while defined, should not be populated for this account.
DN,objectClass,sAMAccountName,givenName,sn,userPrincipalName
The Distinguished Name (DN) portion would be surrounded in quotation marks, as in:
"cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,jeff.hey@cpandl.com
Also, if you are trying to place a comma within an entry, you can double quote it. Just realize that you only want to do that is really want you want to do. For example, if you want the displayName for Jeff Hey to be Hey,Jeff, then you would enter the following first line:
DN,objectClass,sAMAccountName,givenName,sn,displayName,userPrincipalName
Then, you would include a field for each value you wanted to define:
"cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,"Hey,Jeff",jeff.hey@cpandl.com
Further, if you wanted to omit an entry that is defined, you must still represent that field if it is in the definition line. For example, say you use the same definition line as above:
But you do not want to include a displayName for Jeff Hey. Then you would have the following line as an entry for Jeff Hey's account:
"cn=Jeff Hey,ou=HQ,dc=cpandl,dc=com",user,JHey,Jeff,Hey,,jeff.hey@cpandl.com
Effectively the two back-to-back commas are indicating that the displayName, while defined, should not be populated for this account.
The most common problem when exporting data using CSVDE is the export command itself. One thing to keep in mind about exporting is that in Windows Server 2003 R2 and its predecessors, you had to specify -e switch to export. Starting in Windows Server 2008 the -e switch was the default and in order to import, you would have to specify the -i switch.
This article explained how to use the CSVDE command and to troubleshoot it.Hope this article is useful for you.Leave your feedback in comments session.
If you need specific assistance formatting CSVDE files or have specific questions, search the Directory Services Forum ( http://social.technet.microsoft.com/Forums/en-US/winserverDS/threads) and if you are unable to find the answer you need, consider posting a new question there.