PDA

View Full Version : Creating 1700 AD users (W2K)



neleus
06-03-2002, 08:58 PM
I have a project to read to create 1700 user IDs within AD. I am attempting to write a script that will run through and read a tab delemated text file, and parse it through a while loop. Any ideas on how I can read through and store this information in an array of some kind ?

Thanks for any help in advance.

edpud
07-25-2002, 05:19 PM
i have a VB script that'll do it from excel if you like
post a reply if it's of interest

darkness
07-25-2002, 09:17 PM
yup, doing it for same purpose.

-- Code Snipit --
set flatfile = FSO.opentextfile("c:\data\filename.dat")
fullfile = flatfile.readall
alllines = split(fullfile,vblf)
flatfile.close

For each aline in alllines
if aline = "" then exit for end if
'Do some tasks

Next

-- End --

This will read in the the whole file, create an array called allines that holds one line for each arracy value. Close the open file we don't need it anymore. Create a for loop to go through all array values one at a time. Test if the array value is blank if it is exit the loop. This is just incase there is a white space line at the end of the file.

Now to get the tab delimited values from the array line just split them up again in a new array

-- Code Snipit --
datafile = split(aline, vbtab)
-- End --

now you can access each individual value by indicating the column but datafile(I) where I is the number 0 (first value) to N (the last value).

Hope this gets you going, I implimented the same thing for our university of 15K of users.


Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato