CSVDE – Troubleshooting Techniques

Introduction to Troubleshooting CSVDE Techniques

The art of troubleshooting is to narrow down the search.  With CSVDE, there are three avenues to investigate, so the sooner you can rule out two and concentrate on the remaining avenue the better.

  1. Active Directory – Example: does the username already exist.
  2. Excel Spreadsheet – Example: is there a blank column.
  3. CSVDE – The command syntax itself.  Example: an extra comma, or space, perhaps a missing bracket.

Troubleshooting CSVDE Problems

My best advice is – keep it simple.  Get a basic CSVDE example working.  Build on success.  If all else fails try an Export, if that won’t work nothing will.  If that did work, then examine the CSV file, compare the first row of the export with the first row of the import.


Active Directory Mistakes

Remember that you cannot use CSVDE to set user’s passwords, for passwords you need VBScript.  Moreover the default domain Group Policy may be blocking the import unless especially if you set the UserAccountControl = 512.

Other Active Directory problems revolve around spelling mistakes in the name of the domain.  Indeed, in some cases the domain name is not what people thought it was. Launch ADSI Edit to check the spelling of the LDAP properties.

OUs have there share of problems.  Does the OU in your spreadsheet actually exist?  Remember that the USERS is a container is not an OU, so it would be CN=USERS.  Nested OUs give problems, so start by just using a top level OU.  The problem is that the lowest level OU is the first OU in the script. (Lowest is Leftmost).

Spreadsheet Problems

If you are exporting, make sure that a spreadsheet of the same name is not already open.  There must be no blank columns.  Naturally, you can have blank values for non-essential attributes such as displayName.

The DN gives most problems, double check the commas, and speech marks.  One of my nastiest problems was two single quotes pretending to be one double quote.  Another problem was a client thinking dc= meant domain controller.  Wrong, dc= mains domain context.

Guy Recommends:  SolarWinds’ Free Bulk Import ToolFree Download Solarwinds Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD’s attributes, click and import the users.

Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool.

If you need more comprehensive software, download a free trial of SAM (Server & Application Monitor)

CSVDE Error Messages

If you keep on getting the CSVDE help screen, then there is a problem with your switch, for example there is no -e for export.  In order to export, all you need is CSVDE -f filename.csv.

The hardest problem that I had was with an unwanted � that appeared when I tested my examples by copying and pasting from the html page into the CMD prompt.  The extra � only appeared when I copied the text into Word for Windows. For example, CSVDE -i �-f Newport.csv.

Sometimes closing the CMD prompt window, then re-opening magically clears the problem.  When you start a second CMD prompt, CSVDE suddenly works, whereas previously it failed.  I only solved my latest mystery error by logging off and logging on again.   I say again if CSVDE fails or encounters an error it seems to freeze when you subsequently issue a perfectly valid command.

If you get a clear error message then refer to this page.  For example, if the error message begins: "Add error on line 2:" see more here.

Have You Tried…

  • Ignoring errors with – k  (Only works for import)
  • Logging errors with -J  and -v
  • In Active Directory Users and Computers, right-click and Refresh (F5 does not always work)
  • Re-reading the error message – every word, very s l o w l y
  • Opening and closing the CMD Prompt
  • Logoff and logon again
  • Importing to a different top level OU
  • Typing the CSVDE command by hand (Instead of copying and pasting)
  • An Export – who knows what you will find if you examine the first two rows
  • Go away for 10 minutes, take a walk, make a drink, have a bath  (All my best ideas occur in the bath)

Guy Recommends: Permissions Analyzer – Free Active Directory ToolFree Permissions Analyzer for Active Directory

I like thePermissions Monitor because it enables me to see quickly WHO has permissions to do WHAT.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource.  Give this permissions monitor a try – it’s free!

Download Permissions Analyser – Free Active Directory Tool

Troubleshooting CSVDE Summary

Narrow down the problem.  Is it a typo?  Check Active Directory.  Could it be a problem with the spreadsheet, do you have a good CSVDE error message?

If you like this page then please share it with your friends


See Also