Hi everyone,
I'm a computer technician in a high school (anymore of you out there?)
One of our downtown techs created a vbs script to mass create user accounts at each school under our district's 2003 AD structure. He had to make it fairly general to accomodate the needs of each school. So, I'd like to tweak it and I thought that using kix would be the easiest.
From reviewing this site and others, I think I can figure out how to create one account with all it's properties and home folder etc. But I need some help with what terms I should search for to find help with the following concepts:
1. How to extract student information data from the SIRS database (sql) and turn it into a csv file. (If that's a lot of trouble, it is fairly simple just to open the SIRS program and export the data to a csv file).
2. I need to know how to create a loop that will take one line at a time from the csv file and use it to create the user accounts etc.
3. I also need to know if it's more logical to have one loop that does everything at once or should I have three loops; one to create accounts, one to creat home directories and one to create the log file.
4. Finally, I'd like to know if this script seems possible. Or have I bitten off a bit more then I might want to chew.
Thanks in advance for all suggestions,
Jeremy
Code:
; ===========================================================================================
;
; Script Information
;
; Title: Bishop Grandin High School Mass Users Create Program
; Author: Jeremy Schubert
; Description: This script is to be used to create the student computer accounts each semester.
;
; ===========================================================================================
;This script must be Run from the school's computer technician's computer as that machine has
;access to both the \\adminserver And the \\studentserver.
;
;This program has four parts.
;
;1. It will grab the following information from the SIRS from \\adminserver\sirs3$
; (Student Information Records Database, http://www.migsirs.com/cgi-bin/load.pl?page=products):
; Legal First Name, Legal Last Name, Alberta Student ID #, Home Telephone Number, Grade
; It will put that data into a csv file named sirsimport.csv.
; It will then massage the data in the file as follows:
; Remove the area code
; Remove any of the following characters: coma,bracket,hyphen,white-space
; Will change any 'unlisted' phone number to 5555555
; Will combine the first And last legal names into one column in the format of fistname.lastname (which will then become the user account name)
; Will truncate any user account name longer then twenty characters.
;
;2. It will create a home drive For Each user
; The following attributes will be applied While creating the home folders:
; The folders will be named firstname.lastname
; The share name will be firstname.lastname$
; The folders user limit will be Set to 5
; The folder will be housed in \\studentserver\users$\students\grade10,grade11, Or 12
; The share permissions will be Set as follows:
; Domain Administrators will have full control
; User And the teacher group will have change control
; The security permissions will be Set as follows:
; Administrators, Domain Administrators, And System will have full control
; User And the teacher group will have modify
;
;3. It will create a user account For Each user.
; The user accounts will all be put in to the following OU
; domain\user accounts\section06\school047\047Ustudents
; The user accounts will all be added to the following two Global groups:
; ggsection06-students And ggschool047-students
; The user accounts will Each be added to one of the following Global groups:
; gg047-grade10,gg047-grade11,gg047-grade12
; The following properties will be entered For Each user account
; Legal first name And legal last name
; Account name as firstname.lastname
; Password will be their seven digit telephone number And Password will be Set to change on Next logoin
; Home drive path will be \\studentserver\firstname.lastname$
; Profile path will ber \\studentserver\student.man$
; The student's grade and Alberta Education identification number will be entered into
; one of the propertie's fields.
; The accout will be enabled.
;
;4. It will breat a log file
; The log file will be saved to \\studentserver\c$\logs\massu.log
; The log file will record the following events For Each account created:
; "An account has been created for firstname lastname"
; "The account's initial password is xxxxxxx and they will be required to change their password at first login"
; "The user's home folder is located at \\studentserver\users$\students\gradexx"
; "The user has been placed in the ggsection06-students and the ggschool047-students global groups"
; "The user has been placed in the gg047-gradexx global group"
; "The account has been enabled"
;
;The script will end with the message
;"The script is complete. X number of user accounts have been created."
;
;Part One - Grab the information information from SIRS Database (SQL)
;Part Two - Create a loop to create the Home folder for each student
;Part Three - Create a loop to create the User Account for each student
;Part Four - Creat a loop to report success to the log file