The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.
'AddSpridenID.vbs 'Written by Jason Loomans 'This script will take the iSeries student ID on an account, find the corresponding AD account, and add the SPRIDEN ID to the AD account. 'Variables Dim objFSO, arrStr, User strInputFile = WScript.Arguments.Item(0) strOutputFile = WScript.Arguments.Item(1) Const StaffOU = ",<ldappathhere>" Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 'strMsgboxVerify = MsgBox("You are about to add the Banner SPRIDEN ID to all accounts in Active Directory. Continue?",20,"VBScript") 'If strMsgboxVerify = 7 Then ' Wscript.Echo("Script terminated") ' Wscript.Quit(1) ' End if 'Create new data file Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") Set OutFile = objFSO.CreatetextFile(strOutputFile, True) OutFile.WriteLine "Action,Type,Name,EmailAddress,ForceChangePassword,Password,DisplayName,FirstName,LastName" OutFile.Close Set OutFile1 = objFSO.OpenTextFile(strOutputFile,ForAppending,True) 'Open Banner Extract, read SAMAccountName, retrieve, and write correct info to new file. Set objDataFile = objFSO.OpenTextFile(strInputFile,ForReading) On Error Resume Next Do until objDataFile.AtEndofStream arrStr = Split(objDataFile.ReadLine,",") strSAMAcctName = arrStr(2) strEmailAddress = arrStr(3) strDisplayName = arrStr(6) strFirstName = arrStr(7) strLastName = arrStr(8) Set User = GetObject ("LDAP://CN=" & strSAMAcctName & StudentOU) Password = Left(User.Lastname,3) & Right(User.adminDisplayName,5) Password = Ucase(Password) PasswordA = Left(User.Lastname,3) & User.physicalDeliveryOfficeName PasswordA = Ucase(PasswordA) OutFile1.WriteLine "Update,Mailbox," & strSAMAcctName & "," & strEmailAddress & ",1," & PasswordA & "," & strDisplayName & "," & strFirstName & "," & strLastName Loop objDataFile.Close OutFile1.Close 'Delete original file and rename new file to original name objFSO.DeleteFile strInputFile objFSO.MoveFile strOutputFile, strInputFile set objFSO = nothing 'strMsgboxEnd = Msgbox("Finished! Terminating script.",64,"VBScript")