?
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
Medium Priority
?
2,402 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 600 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 900 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

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Let's recap what we learned from yesterday's Skyport Systems webinar.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

777 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