DAckroyd (3rd February 2009)
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
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.
DAckroyd (3rd February 2009)
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
DAckroyd (3rd February 2009)

Can you no longer use CSVDE in 2008?
Haven't used it, but it's in system32 on 2K8 so....
..err... no... you can use it on 2K8.
There are currently 1 users browsing this thread. (0 members and 1 guests)