+ Post New Thread
Results 1 to 5 of 5
Windows Server 2008 Thread, Windows Server 2008: Bulk User Creation in Technical; Does anyone know if you can create a bulk load of users in Active Directory by either using CSV (or ...
  1. #1

    Join Date
    Feb 2009
    Posts
    460
    Thank Post
    66
    Thanked 34 Times in 21 Posts
    Blog Entries
    1
    Rep Power
    19

    Windows Server 2008: Bulk User Creation

    Does anyone know if you can create a bulk load of users in Active Directory by either using CSV (or similar) or if their is a power tools script that will do the job (and if so how to use it?)

    Thanks,
    Dave

  2. #2

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,168
    Thank Post
    98
    Thanked 319 Times in 261 Posts
    Blog Entries
    4
    Rep Power
    113
    Quite easily yes, the scripting guys at Microsoft explain this. I'll put up a URL in a sec.

    Edit: http://www.microsoft.com/technet/scr...8/hey1020.mspx

    There you go. Gives some sample code and takes you through step by step how it works.

  3. Thanks to jamesb from:

    DAckroyd (3rd February 2009)

  4. #3
    ChrisP's Avatar
    Join Date
    Apr 2007
    Location
    norfolk
    Posts
    150
    Thank Post
    4
    Thanked 8 Times in 8 Posts
    Rep Power
    17
    Here is what i use for adding from an excel file. It may be of some use, not much needs changing... Four columns used in the excel sheet are: username,password,lastname,firstname

    HTML Code:
    Dim 	objRootLDAP, objContainer, objUser, objShell
    Dim 	objExcel, objSpread, intRow, strUser, strOU, strSheet
    Dim 	strCN, strSam, strFirst, strLast, strPWD
    
     		HomeServer							= 	"datastore2"
    		strGroup							= 	"students"
    		strOU 								= 	"OU=EHS," ' Note the comma
    		strSheet 							= 	"Z:\!!-Scripts\2009\newusr\src.xls"
    
    Set objRootLDAP = GetObject("LDAP://rootDSE")
    Set 	objContainer 						= 	GetObject("LDAP://" & strOU & objRootLDAP.Get("defaultNamingContext"))
    
    	 	strDNSDomain 						= 	objRootLDAP.Get("DefaultNamingContext")
    Set 	objExcel 							= 	CreateObject("Excel.Application")
    Set 	objSpread 							= 	objExcel.Workbooks.Open(strSheet)
    		intRow 								= 	1 'Row 1 often contains headings
    	
    Do Until objExcel.Cells(intRow,1).Value 	= 	""
       		strSam 								= 	Trim(objExcel.Cells(intRow, 1).Value)
       		strPWD 								= 	Trim(objExcel.Cells(intRow, 2).Value)
       		strLast 							= 	Trim(objExcel.Cells(intRow, 3).Value)
       		strFirst 							= 	Trim(objExcel.Cells(intRow, 4).Value)
       		strCN 								= 	strFirst & " " & strLast
    Set 	objUser 							= 	objContainer.Create("User", "cn=" & strCN)
       		objUser.sAMAccountName 				= 	strSam
          	objUser.displayName 				= 	strCN
          	objUser.description					= 	strSam
       		objUser.givenName 					= 	strFirst
       		objUser.sn 							= 	strLast
           	objUser.HomeDrive 					= 	"Z:"
        	objUser.HomeDirectory 				= 	"\\"&HomeServer&"\"&strSam&"$"
       		objUser.SetInfo
       		objUser.userAccountControl 			= 	512
    		'  objUser.pwdLastSet = 0
       		objUser.SetPassword strPWD
       		objUser.SetInfo
    		intRow 								= 	intRow + 1
    
    
       
         Set objGroup 		= GetObject("LDAP://cn="&strGroup&",cn=users,"&strDNSDomain)
         objGroup.Add  objUser.AdsPath

  5. Thanks to ChrisP from:

    DAckroyd (3rd February 2009)

  6. #4

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,600
    Thank Post
    109
    Thanked 769 Times in 598 Posts
    Rep Power
    181
    Can you no longer use CSVDE in 2008?

  7. #5

    Join Date
    Jan 2006
    Location
    Surburbia
    Posts
    2,178
    Thank Post
    74
    Thanked 307 Times in 243 Posts
    Rep Power
    115
    Haven't used it, but it's in system32 on 2K8 so....

    ..err... no... you can use it on 2K8.

SHARE:
+ Post New Thread

Similar Threads

  1. Bulk user Creation
    By Jamie_a in forum Windows
    Replies: 10
    Last Post: 14th January 2009, 06:30 PM
  2. Replies: 5
    Last Post: 10th December 2008, 12:59 PM
  3. bulk user creation
    By jonbones in forum Network and Classroom Management
    Replies: 1
    Last Post: 18th June 2008, 10:43 AM
  4. Bulk User Creation Tools
    By mark in forum Downloads
    Replies: 16
    Last Post: 10th July 2007, 04:24 PM
  5. Bulk user creation
    By Dos_Box in forum How do you do....it?
    Replies: 63
    Last Post: 13th November 2006, 07:02 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •