active directory script to add users to active directory

need to add about 150 users to active directory (windows 2008 r2)
anyone have a good script that will allow me to add these in a bulk format from excel?
LVL 1
jsctechyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Krzysztof PytkoSenior Active Directory EngineerCommented:
From Excel no, but from CSV file generated from Excel yes. You can use PowerShell for that. If you are interested, please provide some Excel file details to be able to prepare script for you

Regards,
Krzysztof
0
RobSampsonCommented:
There's an example of readin an Excel spreadsheet to create users here:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_26961670.html

Regards,

Rob.
0
RetiredScriptingGuyCommented:
Depends if the users want to keep their passwords or not. If they do, I would recommend using the following tool to import users to any active directory schema. It is a free tool and already included with Windows Server 2008R2. Why duplicate something that is already done for you?

http://technet.microsoft.com/en-us/library/bb727091.aspx

Retired Scripting Guy

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gs121Commented:
I use the following for tets accounts.
prepare tab delimited file with following fields (export from excel)
Test with one user, to see what fields you need.
I use the spreadsheet to give each user a different password.

Last      First      UserID      PW            Desc

add any fields (usr attributes you want ( New-QADUser  line))  run script below.
modify for you domain
********************************************

#OU to create users in  
$OU = "OU=TestAccounts,dc=mmycompany,dc=com"
$count = 0


#csv to import
import-csv scm.txt -Delimiter "      "  | ForEach-Object{
$count = 0
#combine fields for data

$displayname = $_.First+ " "+$_.Last #combine first and last names

    #create ID
    write-host "User ID being Created",$samaccountname,$count
    New-QADUser -ou $OU -Name $displayname -Description $_.Desc -UserPassword $_.PW -SamAccountName $_.userid `
      -FirstName $_.First -LastName $_.Last `
      -UserPrincipalName "$($_.userid)@mycompany.com"
      

}
0
MilesLoganCommented:
This is what I use ..just update the Excel sheet with your users info and your ready to go .

http://www.rlmueller.net/CreateUsers.htm
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.

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.