kevan79 Posted March 31, 2005 Posted March 31, 2005 OK, I'm back to suck more knowledge from the board.I've found alot of this script from both microsoft and a couple websites.My questions is, how do I program it to read the OU name from, say column 1 of an Excel document? Also, if the OU didn't exist, is there a way for it to make it?Once again, thanks to all those that are so helpful on this board.Also, is there anything that I'm leaving out that really should be in there?NOTE: I've not gotten to test any of this out, as I'm working at it at home.'script to read user information from an Excel File and add them to the domainSet objExcel = CreateObject("Excel.Application")Set objWorkbook = objExcel.Workbooks.Open _ ("C:\Scripts\New_users.xls")intRow = 2Do Until objExcel.Cells(intRow,1).Value = "" Set objOU = GetObject("ou=Data, dc=deployed.af, dc=mil") Set objUser = objOU.Create _ ("User", "cn=" & objExcel.Cells(intRow, 1).Value) objuser.userPrincipalName = objExcel.cells(intRow, 9).value objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value objUser.GivenName = objExcel.Cells(intRow, 3).Value objUser.SN = objExcel.Cells(intRow, 4).Value objUser.AccountDisabled = FALSE objuser.mail = objExcel.cells(intRow, 5).Value objUser.SetInfo intRow = intRow + 1LoopobjExcel.Quit
kevan79 Posted March 31, 2005 Author Posted March 31, 2005 Ok, I'm at work now and I've obviously gotten soemthing wrong with the script.I get the Following error.Line 8, Char 4, invalid syntax. Code 800401E4, Source (null)Not sure what I'm doing wrong here if someone can look at the coding, that would be great.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now