Solved

Create AD users with Powershell and CSV file.

Posted on 2011-02-16
5
905 Views
Last Modified: 2012-05-11
Would someone be able to help me create a script that could read from a CSV file to create AD users?  If someone could at least give me a basic idea of the snytax I would appreciate it.  Also, does it make any difference that this is a Server 2003 domain?
0
Comment
Question by:Go-GBS
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Richard2k4 earned 150 total points
ID: 34909410
Look at the quest QAD controls.  Pretty sure there is a cmdlet that can do it.
0
 
LVL 27

Assisted Solution

by:KenMcF
KenMcF earned 100 total points
ID: 34909463
I agree the quest tools will be the easiest. What does your CSV file hearder look like?
This is not tested..
Here is an example

Firstname,Lastaname,samccountname
Test,User,tuser

$users = import-csv c:\users.csv
$Users | %{
new-qaduser  -name $_.name -samaccountname $_.samaccountname -FirstName $_.firstName -LastName $_.LastName -parentcontainer "OU=UserAccount,DC=Domain,DC=Local" -userpassword "P@ssw0rd"
}
0
 

Author Comment

by:Go-GBS
ID: 34910620
http://www.quest.com/powershell/

Is this where you're referring to?
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 34910747
0
 

Author Comment

by:Go-GBS
ID: 34916894
Thank you for the help.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. 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

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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