Page 1 of 1

Creating users from CSV file in AD

Posted: Wed May 28, 2008 7:53 am
by RTorres9
Hello, I need some assistance in creating a script that will read data from a CSV file and create a new user in the right OU from this information. For unknow reasons the script fails right at the moment of when I use the command of "objUser.SetInfo". The error message is " A constraint violation occurred." Please advise any assistance would be greatly appreciated!! Please see the attached documuploads/27202/pretest.txtents.

Creating users from CSV file in AD

Posted: Wed May 28, 2008 7:53 am
by RTorres9
Hello, I need some assistance in creating a script that will read data from a CSV file and create a new user in the right OU from this information. For unknow reasons the script fails right at the moment of when I use the command of "objUser.SetInfo". The error message is " A constraint violation occurred." Please advise any assistance would be greatly appreciated!! Please see the attached documuploads/27202/pretest.txtents.

Creating users from CSV file in AD

Posted: Thu May 29, 2008 5:08 am
by donj
Probably the easiest way to do this is in Windows PowerShell using the cmdlets from www.quest.com/powershell.

Import-CSV <filename> | ForEach-Object { New-QADUser -ou <ou_name> -property $_.column }

Replace -property with the AD property name (as in, -city, -samaccountname, -sn, or whatever). Replace $_.column with the column name from the CSV (as in, $_.CityName, $_.LogonName, $_.LastName or whatever).

PowerGui.org provides support forums for those cmdlets.

Creating users from CSV file in AD

Posted: Thu May 29, 2008 5:42 am
by RTorres9
Hi Donj,
Thanks for looking into my issue. I'm not familiar at all with PowerShell or profecient with VB scripts as you could see. However I will look into the PowerGUI web site. Once I get this part of the script going. I see it extending it into where I'll be using decision making process in placing the new users object into different container based on thier site location which will be identifed in a colume in the CSV file.
I noticed that thier are examples of using Powershell with Exchange management. Would Powershell work for scripts for Lotus Notes mailboxes? Please advise, RTorres9