Solved

Bulk user creation script

Posted on 2004-03-30
9
544 Views
Last Modified: 2010-04-19
Hi

I have an excel spreadsheet containing a large number of usernames, password, and various other attributes from which I would like to create users in an Active Directory Domain.
I need a script (preferably vbs) which will reference the spreadsheet, looping through the rows and create the users for automatically me.
0
Comment
Question by:toffee
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 2

Expert Comment

by:Ugrum
Comment Utility
You can use utilities such as ldifde and cvsde to automate bulk object creation tasks.
0
 

Author Comment

by:toffee
Comment Utility
Thanks  I am aware of those but am really after a vbscript using ADSI as I am a bit more familiar with that and hope to use this as the basis of other scripts for the future.
0
 
LVL 2

Expert Comment

by:Ugrum
Comment Utility
Then take a look at the following link:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
a LOT of examples there, should be enough to make what you want.
0
 
LVL 20

Expert Comment

by:What90
Comment Utility
I used Active Directory Cookbook. I found this book a great help.

Have a look at some of the demo codes in the users section:
http://www.rallenhome.com/books/adcookbook/code.html
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:toffee
Comment Utility
Loads of useful info in there in clear simple scripts which I like.  But what I'm really after is something which will take the usernames/passwords/descriptions from a spreadsheet and create the users in AD.

I suppose I could write some thing in VBA which will create a text file in .ldf format then use LDIFDE to create the users, but I was hoping someone had a script which would do it in the one operation i.e. a vbs accessing excel to get the information and setting up the users as it goes.
0
 
LVL 3

Expert Comment

by:following
Comment Utility
I used the sample code from this article: http://www.winnetmag.com/Article/ArticleID/19830/19830.html

I modified it to fit my environment, adding/removing AD properties as necessary to fit our users.  There is an error when you press ctrl-d to run the code: click debug and change both references to frmLocalAdminPwd to frmUserCreation.  I added another worksheet into which I pasted all my users, passwords, etc.  I then made the code loop through each cell of the worksheet, instead of taking each user individually.

Hope this helps,
-jdm
0
 
LVL 3

Accepted Solution

by:
following earned 500 total points
Comment Utility
Here is another example that may be helpful:

http://cwashington.netreach.net/depo/view.asp?Index=915&ScriptType=vbscript

I have found the scripts from cwashington to be of excellent quality -- I haven't tried this one, but it looks fairly standard to me.

-jdm
0
 

Author Comment

by:toffee
Comment Utility
Thanks following.

Thats just what I need.
0
 
LVL 3

Expert Comment

by:following
Comment Utility
Toffee,

I really appreciate the thank you!  It's actually nicer to know that the solution helped than to just gain more points...

-jdm
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

15 Experts available now in Live!

Get 1:1 Help Now