Solved

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

Posted on 2011-03-17
12
2,302 Views
Last Modified: 2012-05-11
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
Comment
Question by:ReinhardRensburg
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 200 total points
ID: 35156071
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
 
LVL 37

Expert Comment

by:Neil Russell
ID: 35156138
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
 

Author Comment

by:ReinhardRensburg
ID: 35156183
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
 

Author Comment

by:ReinhardRensburg
ID: 35156199
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
 
LVL 13

Accepted Solution

by:
martin_babarik earned 300 total points
ID: 35156285
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
 

Author Comment

by:ReinhardRensburg
ID: 35156376
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
 
LVL 37

Expert Comment

by:Neil Russell
ID: 35156438
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
 

Author Comment

by:ReinhardRensburg
ID: 35156490
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
 
LVL 12

Expert Comment

by:Navdeep
ID: 35156677
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
 

Author Comment

by:ReinhardRensburg
ID: 35163380
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
 
LVL 12

Expert Comment

by:Navdeep
ID: 35163402
Sure Reinhard.
0
 

Author Closing Comment

by:ReinhardRensburg
ID: 35163913
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

Join & Write a Comment

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
Synchronize a new Active Directory domain with an existing Office 365 tenant
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now