LISTING 1: CreateStudents.vbs Option Explicit Dim objFSO, objFile, objContainer, objStudent Dim strCsvFile, strCsvFileContents, strContainer, strRecord Dim arrRecords, arrFields Dim strStudent, strFirstName, strLastName, strDescription Dim strAddress, strCity, strState, strZip, strTelephone, strPassword Const ForReading = 1 ' BEGIN CALLOUT A strCsvFile = "C:\Scripts\Students.csv" strContainer = "ou=Students,dc=OrchardGrove,dc=org" ' END CALLOUT A ' BEGIN CALLOUT B Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strCsvFile, ForReading) strCsvFileContents = objFile.ReadAll objFile.Close ' END CALLOUT B ' BEGIN CALLOUT C arrRecords = Split(strCsvFileContents, vbCrLf) ' END CALLOUT C Set objContainer = GetObject("LDAP://" & strContainer) For Each strRecord In arrRecords ' BEGIN CALLOUT D arrFields = Split(strRecord, ",") strStudent = arrFields(0) strFirstName = arrFields(1) strLastName = arrFields(2) strDescription = arrFields(3) strAddress = arrFields(4) strCity = arrFields(5) strState = arrFields(6) strZip = arrFields(7) strTelephone = arrFields(8) strPassword = arrFields(9) ' END CALLOUT D ' BEGIN CALLOUT E Set objStudent = objContainer.Create("User", "cn=" & strStudent) objStudent.Put "sAMAccountName", strStudent objStudent.Put "givenName", strFirstName objStudent.Put "sn", strLastName objStudent.Put "description", strDescription objStudent.Put "streetAddress", strAddress objStudent.Put "l", strCity objStudent.Put "st", strState objStudent.Put "postalCode", strZip objStudent.Put "telephoneNumber", strTelephone objStudent.SetInfo objStudent.SetPassword strPassword objStudent.AccountDisabled = False objStudent.SetInfo Set objStudent = Nothing Next ' END CALLOUT E