• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2534
  • Last Modified:

CSVDE Import fails with error "Invalid Syntax on line 2, The parameter is incorrect." (Active Directory, Server 2008)

Hi,

I am trying to import users into AD using CSVDE but it fails with "Invalid Syntax on line 2: The parameter is incorrect."

We are running Server 2008 R1 32-Bit STD (Domain controllers are set to a 2003 Functional Level). We've got a single domain forest, nothing too complicated, I am busy trying to create AD Users for one of our divisions.

My File Format, columns, headings etc. are definitely 100% correct and it can't be due to the incorrect content in the .csv File, here is my reason for saying so:

I did the following test:

I log onto our "main" AD Domain Controller / Global Catalog Server with the Domain Administrator account, go to the command prompt, run the csvde -f adexport.csv in order to generate a file with the correct content (headings columns etc.) that contains all our existing AD objects.

I then open this .csv file in Microsoft Excel 2007, select all the rows except the 1st one (with the headings) and the last one (which is an AD user I created last) and delete the rest, the file then effectively still contains the exact same columns, the same headings in row 1 of the columns and the last row with the last AD user I created, so the format should be 100% correct.

I then try and import this file back into AD with the CSVDE -i -f adexport.csv and immediately get the error "Invalid Syntax on line 2, The parameter is incorrect." without even modifying or adding any parameters in the file.

I then thought it might be because the AD user in the .csv file already exsits in AD, so I went to dsa.msc on the same Domain Controller and deleted the user from AD, then ran the CSVDE -i -f adexport.csv again but to no avail, still the same error.

So my question is basically: why am I getting an error when trying to import the .csv file generated into AD generated by CSVDE if I have not touched the columns, column headings etc? What am I missing or doing wrong?

Thank you for any assistance.

Regards,
Reinhard.

0
Reinhard Rensburg
Asked:
Reinhard Rensburg
  • 6
  • 3
  • 2
  • +1
2 Solutions
 
Neil RussellTechnical Development LeadCommented:
Your problem is that a simple csvde -f adexport.csv exports ALL of the AD fields relating to ALL objects. only a very small number of these are needed to do an import.

Have a good read here
http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Bulk.htm
0
 
Neil RussellTechnical Development LeadCommented:
IF you have exchange 2010 as well in your environment then perhaps you need to consider PowerShell methods instead of just CSVDE.

See here for a scripted aproach.  http://www.myexchangeworld.com/2010/02/powershell-provisioning-users/
0
 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Hi Neilsr,

Thanks for your e-mail, call it coincidence if you, I was actually on that exact same website reading about CSVDE when I received your reply.

I was a bit scared to go and remove unneeded columns as I thought that the import would require a .csv file with the exact same columns, but from the website you sent me I saw that this was not the case and one can add only the columns required.

I had a thorough read through the website explaining exports and imports, what I do notice is that talk about importing users (as if they do not exist yet) but nowhere do they mention that CSVDE can be used to modify existing users, do you perhaps know if one can indeed use CSVDE's import function to add aditional info. (name, surname, e-mail address etc) to users that already exist in AD?

Thanks,
Reinhard.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Hi Neilsr,

Thanks for the second post, we do not use Exchange at all, we are on a different e-mail system all together that does not integrate with AD.

Regards,
Reinhard.
0
 
martin_babarikCommented:
Hi Reinhard,

If I can join this discussion - CSVDE is good to create new objects.

If you need to modify existing objects, then you need to use another tool, which is called LDIFDE.

From command line it works very similar like CSVDE, the difference is, that for CSVDE you use CSV files as input, for LDIFDE you use LDF files as input.
You can see some sample use here:
http://support.microsoft.com/kb/237677

But if you need something more complex, maybe VBScript or Powershell could be a solution for you.

Regards

Martin
0
 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Hi Martin,

Thank you for your comment,

I've had a look at the link you sent, would it be possible to still use a .csv file and somehow "convert" it to a .LDF File in order to use the data I've got in .csv to import into AD?

The reason I ask the question is: We just went over to AD (during the last year), about 550 users. All the users on our network is on Active Directory, I need to now update certain fields that have not been filled in on the initial creaton of the users (like title, department, a contact number etc.) so I've gathered most of this by asking the divisions' HR departments to send the info to me in Excel Files, so I only have the data in .xls (which I've saved in .csv) and would need some way to use these .csv files as the source of the info. that I need to import into AD.

Thanks for any assistance.

Regards,
Reinhard.
0
 
Neil RussellTechnical Development LeadCommented:
One of the best investments you could make I would say, is for you to go to http://www.dovestones.com/products/Active_Directory_Tools.html and purchase the toolkit there. Can do wonders for you!!

Have a look before you go any further.
0
 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Thanks Neilsr,

I will have a look and revert back.

From what I gather then CSVDE is not really the right "tool" to do stuff like update existing AD objects' properties...

Regards,
Reinhard.
0
 
NavdeepCommented:
Hi,

I can help you write a piece of code using powershell and quest ad command lets. The script will read the parameters and create the users.

you need to install questAD commandlets which is free of cost. Also if you are still interested in this way, plz upload a sample of your csv file
0
 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Hi v-2nas,

Thanks for your comment,

I would like to first see if there's not a way to do this natively with CSVDE or LDIFDE which comes standard with the O/S, my personal experience is that the moment one relies on 3rd party tools and appslets it complicates things as one then depends on other software, support etc. as where the CSVDE and LDIFDE "apps" are supported, updated and looked after Microsoft themselves.

Thanks for offering assistance with the Powershell code,  I will get back to you should I not come right with using the aforementioned two built-in Microsoft "apps" natively to modify AD users.

Regards,
Reinhard.
 
0
 
NavdeepCommented:
Sure Reinhard.
0
 
Reinhard RensburgInfrastructure ManagerAuthor Commented:
Model of the story: CSVDE is for creating new AD objects and doing exports of the current AD objects, LDIFDE is better for exporting, modifying and importing again, 3rd party apps are also an option...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now