Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '* Script Name: UserAccount.VBS
- '* Author: Jeffrey Lathrop
- '* Written: February 16, 2003
- '* Purpose: To Automate the account creation process for the HelpDesk. This script will
- '* create a unique alias, populate the address fields (city, state, zip, phone), office,
- '* description, create the mailbox, create a password, email the information to the office
- '* admin, and create a work log.
- '*------------------------------------------------------------------------------------------------------------------------------------
- '*$Log: I:/Applications/PVCS8/Data/Provisioning/archives/AD Scripts/useraccount1.vbs-arc $
- '*
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide
- '*------------------------------------------------------------------------------------------------------------------------------------
- '*
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls
- '*------------------------------------------------------------------------------------------------------------------------------------
- '* Date: Feb 15, 2013
- '* Incident # 6282 cbcaps0033, mej 02/15/2013
- '* What was changed?: modify to load department information into active directory add include files
- '* Reason for Change: need department information for downstream data use like ciber university
- '*------------------------------------------------------------------------------------------------------------------------------------
- '* Date: Feb 15, 2012
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012
- '* What was changed?: modify to read domain controller from caps controller
- '* Reason for Change: enable the exchange creation and active directory creation use the
- '* same domain controller for creation
- '*------------------------------------------------------------------------------------------------------------------------------------
- '* Date: Aug 19, 2011
- '* Ticket: 243168, CBCAPS0004
- '* What was changed: modified call for createmailuser to call powershell enable_cibermailbox.ps1 script
- '* Modified by: Mark Johnson
- '* Reason for Change: Exchange 2007 does not allow vbs to create email mailboxes
- '*------------------------------------------------------------------------------------------------------------------------------------
- '* Rev 1.8 Feb 13 2006 13:55:44 TBatuwitage
- '*02/13/2006 - Call#: 00041986 - Changes PW text to autouseraccount.vbs and useraccount1.vbs
- '*
- '*Added/removed text from the existing scripts to resemble the sample screen that was given by Farhad.
- '*
- '*
- '* Rev 1.7 06 Feb 2006 12:52:10 aludlow
- '*2006.02.06 - 41983 - Changes dist list to autouseraccount.vbs and useraccount1.vbs. Changed ".CORP CIBER Europe" to ".EU"
- '*
- '* Rev 1.6 24 Jan 2006 09:42:58 aludlow
- '*2006.01.24 - Call # 41251 - Change CIBER-COM to CIBERspace in script
- '*
- '* Rev 1.5 11 Jan 2006 10:30:58 aludlow
- '*2006.01.11 - Call # 37512 - Modify the account automation script. Modified the script not to change the batch file that an individual was associated with.
- '*
- '* Rev 1.4 Oct 28 2005 14:33:44 aludlow
- '*2005.10.28 - Call # 35160 - CIBEREurope and CSP All Emp - Commented out code that added the Europeans in the CSP All Emp security group.
- '*
- '* Rev 1.3 Sep 21 2005 12:19:14 aludlow
- '*Corrected an issue with a change I made.
- '*
- '* Rev 1.2 Sep 19 2005 12:01:32 aludlow
- '*Changes at Farhad's request.
- '*
- '* Rev 1.1 Aug 09 2005 15:02:36 aludlow
- '*Reviewed
- '*
- '* Rev 1.0 Aug 09 2005 14:42:22 aludlow
- '*Initial Revision
- '*------------------------------------------------------------------------------------------------------------------------------------
- '*On Error Resume Next
- Call Main()
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department begin add includefile
- sub includeFile (fSpec)
- wscript.echo "include file "& fspec
- dim fileSys, file, fileData
- set fileSys = createObject ("Scripting.FileSystemObject")
- set file = fileSys.openTextFile (fSpec)
- fileData = file.readAll ()
- file.close
- executeGlobal fileData
- set file = nothing
- set fileSys = nothing
- end sub
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department end add includefile
- function MODulus (ByVal iNumber, ByVal iDivisor)
- DIM iVal
- DIM itemp
- if (iDivisor > 0) then
- iVal = Int(iNumber)/Int(iDivisor)
- itemp = Int(iVal) * iDivisor
- if (itemp > iNumber) then
- itemp = Int(iVal-1) * iDivisor
- end if
- Modulus = Int(iNumber) - Int(itemp)
- else
- Modulus = 0
- end if
- end function
- function StripTrailingWS(str)
- DIM rtstr
- if (len(str) > 0) then
- isws = 0
- if (Right(str,1) = " ") then
- rtstr = StripTrailingWS(Left(str,Len(str)-1))
- else
- rtstr = str
- end if
- StripTrailingWS = rtstr
- else
- StripTrailingWS = str
- end if
- end function
- function TestDivision(ByVal cc)
- DIM ppre
- if cc < 2000 then
- ppre = "CP"
- elseif cc < 4000 then
- ppre = "ES"
- elseif cc < 7000 then
- ppre = "CS"
- elseif cc < 9100 then
- ppre = "ES"
- else
- ppre = "CP"
- end if
- TestDivision = ppre
- end function
- function CreatePassword(ByVal eid, ByVal cc)
- Randomize()
- DIM remainder
- DIM pwd
- pwd=" "
- remainder = Modulus(Int(right(eid,5)),5)
- Select Case remainder
- Case 1
- pwd = chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 65))
- pwd = pwd & chr(Int(12 * RND + 33))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 97))
- Case 2
- pwd = chr(Int(12 * RND + 33))
- pwd = pwd & chr(Int(25 * RND + 65))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 97))
- Case 3
- pwd = chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 65))
- pwd = pwd & chr(Int(12 * RND + 33))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- Case 4
- pwd = chr(Int(12 * RND + 33))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 65))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 97))
- Case else
- pwd = chr(Int(25 * RND + 65))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(12 * RND + 33))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(25 * RND + 97))
- pwd = pwd & chr(Int(9 * RND + 48))
- pwd = pwd & chr(Int(25 * RND + 97))
- End Select
- pwd = replace(pwd,"I","L")
- pwd = replace(pwd,"1","L")
- pwd = replace(pwd,"l","L")
- pwd = replace(pwd,"0","M")
- pwd = replace(pwd,"O","M")
- pwd = replace(pwd,"o","M")
- CreatePassword = pwd
- End function
- function GenerateNBAlias(ByVal Ln, ByVal Fn, ByVal MI, ByVal i)
- Dim flen
- Dim j
- j = 0
- flen = Len(fn)
- if (i > flen) then
- j = i - flen
- end if
- if (j > 0) then
- if (Len(MI) > 0) then
- GenerateNBAlias = Fn&MI&Ln&j
- else
- GenerateNBAlias = Fn&LN&j
- end if
- elseif (i>1) then
- if (Len(MI) > 0) then
- GenerateNBAlias = Left(Fn,i-1)&MI&LN
- else
- GenerateNBalias = Left(Fn,i)&LN
- end if
- else
- GenerateNBAlias = Left(Fn,i)&LN
- end if
- End Function
- function GenerateBAlias(ByVal Ln, ByVal Fn, ByVal MI, ByVal i)
- DIM j
- if (i = 1) then
- GenerateBAlias = Ln & "_" & Fn
- elseif (i = 2) then
- if (Len(MI) > 0) then
- GenerateBAlias = Ln & "_" & Fn & "_" & MI
- else
- GenerateBAlias = Ln & "_" & fn &j
- end if
- else
- if (Len(MI) > 0) then
- j= i - 2
- GenerateBAlias = Ln & "_" & Fn & "_" & MI & j
- else
- j = i - 1
- GenerateBAlias = Ln & "_" & fn &j
- end if
- end if
- end Function
- function IsConsultant(ByVal etype)
- DIM scid
- scid = Left(etype,2)
- if (scid = "LC") then
- IsConsultant = 1
- elseif (etype <= 01199) then
- IsConsultant = 1
- elseif (etype >= 01700) then
- IsConsultant = 1
- else
- IsConsultant = 0
- end if
- end Function
- function GetTitle(ByVal etype)
- DIM emtystr,emtstr2
- emtystr = Left(etype,3)
- emtystr2 = Left(etype,2)
- if ((emtystr = "011") or (emtystr2 = "11")) then
- GetTitle = "Consultant"
- elseif ((emtystr = "012") or (emtystr2 = "12"))then
- GetTitle = "Sales Exec"
- elseif ((emtystr = "013") or (emtystr2 = "13")) then
- GetTitle = "Administration"
- elseif ((emtystr = "014") or (emtystr2 = "14")) then
- GetTitle = "Recruiter"
- elseif ((emtystr = "015") or (emtystr2 = "15")) then
- GetTitle = "Manager"
- elseif ((emtystr = "016") or (emtystr2 = "16")) then
- GetTitle = "CSM"
- else
- GetTitle = "Subcontractor"
- end if
- end function
- Sub CreateNewHiresFile(ByVal iNumUsers)
- DIM cnhffso
- DIM outFile
- DIM costcenter
- DIM lastname
- DIM firstname
- DIM middleinitial
- DIM empid
- DIM emptype
- DIM strTest
- DIM stralias
- DIM strEmail
- strtest = ""
- emptype = "01100"
- Set cnhffso = CreateObject("Scripting.FileSystemObject")
- Set OutFile = cnhfFSO.CreateTextFile("c:\euNewhires.txt",True)
- OutFile.WriteLine "CostCenter" & Chr(9) &"LastName" & Chr(9) &"FirstName" & Chr(9) & "MiddleInitial" & Chr(9) & "EmployeeID" & Chr(9) & "JobCode" & Chr(9) &"Alias" & Chr(9) &"EmailTo"
- for i = 1 to iNumUsers
- while (strtest <> "Y")
- costcenter = ""
- lastname = ""
- firstname = ""
- middleinitial = ""
- empid = ""
- strtest = ""
- stralias= ""
- strEmail = ""
- Wscript.Stdout.Write "Enter Cost Center: "
- costcenter = Wscript.Stdin.Readline
- Wscript.Stdout.Write "Enter Last Name: "
- lastname = Wscript.Stdin.Readline
- Wscript.Stdout.Write "Enter First Name: "
- firstname = Wscript.Stdin.Readline
- Wscript.Stdout.Write "Enter Middle Initial: "
- middleinitial = Wscript.Stdin.Readline
- Wscript.Stdout.Write "Enter Employee ID: "
- empID = Wscript.Stdin.Readline
- Wscript.Stdout.Write "Enter Alias: "
- stralias = Wscript.Stdin.Readline
- WScript.Stdout.Write "Enter CIBER Europe Email Address: "
- strEmail = Wscript.Stdin.Readline
- while ((strtest <> "Y") AND (strtest <> "N"))
- Wscript.Stdout.Writeline "Are these values correct (Y/N)?"
- Wscript.Stdout.Write costcenter & " " & Lastname & " " & Firstname & " " & Middleinitial & " " & empid & " " & emptype & " " & stralias & " " &strEmail& " (Y/N) "
- strTest = UCASE(Wscript.Stdin.Readline)
- Wend
- if (strtest = "Y") then
- OutFile.WriteLine costcenter & Chr(9) & lastname & Chr(9) & firstname & Chr(9) & MiddleInitial & Chr(9) & empid & Chr(9) & emptype & Chr(9) & stralias & Chr(9) & strEmail
- end if
- wend
- Next
- Outfile.Close
- set OutFile = Nothing
- set cnhffso = Nothing
- End Sub
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Sub CheckAlias (ByVal Ln, ByVal Fn, ByVal MI, ByVal eid, ByVal etype, ByVal NBorB, ByVal group_base, ByVal FQDN, ByVal Root_DN, ByVal Emailbase,strAlias, StrStatus)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- WScript.Echo "Start CheckAlias"
- DIM objCommand
- DIM objConnection
- DIM unique
- DIM subCtest
- DIM i
- DIM objRecordset, objRecordSet1
- DIM tid
- DIM emailTest
- DIM eaExist
- DIM objUser
- unique = 0
- i = 1
- subcTest = Left(eid,2)
- strStatus = "OK"
- eaExist = 0
- Set objConnection = CreateObject("ADODB.Connection")
- objConnection.Open "Provider=ADsDSOObject;"
- Set objCommand = CreateObject("ADODB.Command")
- objCommand.ActiveConnection = objConnection
- objCommand.Properties("Chase Referrals") = ADS_CHASE_REFERRALS_SUBORDINATE
- objCommand.Properties("Page Size")= 1000
- objCommand.Properties("Size Limit")= 15000
- objCommand.Properties("Sort On") = "Name"
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' objCommand.CommandText = "<GC://"&group_base"dc=ciber,dc=cbr,dc=inc>;(&(objectCategory=Person)(proxyAddresses=*));samAccountName,proxyaddresses,distinguishedname;subtree"
- objCommand.CommandText = "<GC://"&group_base&">;(&(objectCategory=Person)(proxyAddresses=*));samAccountName,proxyaddresses,distinguishedname;subtree"
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Set objRecordSet1 = objCommand.Execute
- while unique = 0
- wscript.echo strAlias
- objCommand.CommandText = "<"&FQDN&">;(&(objectCategory=User)(samAccountName=" & strAlias & "));samAccountName,employeeID,distinguishedname;subtree"
- Set objRecordSet = objCommand.Execute
- If objRecordset.RecordCount = 1 Then
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'wscript.echo objRecordSet.Fields("employeeID")
- Set objUser = GetObject(Root_DN&"/"&objRecordSet.Fields("distinguishedName"))
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- objUser.GetInfo
- tid = objUser.Get("employeeID")
- wscript.echo tid
- if (eid = tid) then
- StrStatus = "Account Already Exists"
- unique = 1
- else
- unique = 0
- end if
- else
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'EmailTest = "smtp:"&strAlias&"@ciber.com"
- EmailTest = "smtp:"&strAlias&emailbase
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Do While Not objRecordSet1.EOF
- For Each varRecord in objRecordset1.Fields("proxyAddresses").Value
- If UCASE(varRecord) <> UCASE(emailtest) then
- Else
- eaExist = 1
- Exit Do
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- end if
- Next
- objRecordset1.MoveNext
- Loop
- if (eaExist = 0) then
- unique = 1
- StrStatus = "OK"
- else
- eaExist = 0
- unique =0
- end if
- set objRecordset1 = Nothing
- end if
- i = i + 1
- wend
- set objRecordSet = Nothing
- set objUser = Nothing
- set objConnection = Nothing
- set objCommand = Nothing
- Wscript.Echo "End CheckAlias"
- End Sub
- Sub ReadCostCenterTable(ByVal cc, country, lcity, postalcode, state, streetaddress, telephoneNumber, uOU, sOfficeName, srv, nbmserver, bmserver, bstore,emailto )
- Wscript.Echo "Start ReadCostCenter"
- Const adOpenStatic = 3
- Const adLockOptimistic = 3
- Const adUseClient = 3
- DIM objConnection
- DIM objRecordset
- Set objConnection = CreateObject("ADODB.Connection")
- Set objRecordset = CreateObject("ADODB.Recordset")
- objConnection.Open "data source='Accounts';"
- objRecordset.CursorLocation = adUseClient
- objRecordset.Open "SELECT * FROM CostCenter WHERE CostCenter = '"&cc & "'" , objConnection, adOpenStatic, adLockOptimistic
- if (objRecordSet.RecordCount <> 1) then
- uOU = "NewUsers"
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'emailto = "helpdesk@ciber.com"
- emailto = emailtostatic
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- else
- country = StripTrailingWS(objRecordSet.Fields("country"))
- lcity = StripTrailingWS(objRecordSet.Fields("city"))
- postalcode = StripTrailingWS(objRecordset.Fields("zip"))
- state = StripTrailingWS(objRecordSet.Fields("state"))
- streetaddress = StripTrailingWS(objRecordSet.Fields("street"))
- telephoneNumber = StripTrailingWS(objRecordSet.Fields("phone"))
- uOU = StripTrailingWS(objRecordSet.Fields("OU"))
- sOfficeName = StripTrailingWS(objRecordSet.Fields("OfficeName"))
- srv = StripTrailingWS(objRecordSet.Fields("server"))
- nbmserver = StripTrailingWS(objRecordSet.Fields("mbserver"))
- bmserver = StripTrailingWS(objRecordSet.Fields("bserver"))
- bstore = StripTrailingWS(objRecordSet.Fields("bstore"))
- emailto = StripTrailingWS(objRecordSet.Fields("emailTo"))
- end if
- objRecordset.Close
- objConnection.Close
- set objRecordset = Nothing
- set objConnection = Nothing
- Wscript.Echo "End ReadCostCenter"
- End Sub
- Sub ReadMBServer(ByVal mbserver,mbstore, mbstoregrp, mbadmingrp,ByVal etype)
- Wscript.Echo "Starting ReadMBServer"
- Const adOpenStatic = 3
- Const adLockOptimistic = 3
- Const adUseClient = 3
- DIM objConnection
- DIM objRecordset
- Set objConnection = CreateObject("ADODB.Connection")
- Set objRecordset = CreateObject("ADODB.Recordset")
- objConnection.Open "data source='Accounts';"
- objRecordset.CursorLocation = adUseClient
- '* Ticket: 243168, CBCAPS0004 begin
- '* old
- '* if (etype = "0") then
- '* objRecordset.Open "SELECT * FROM MBServers WHERE store = '"&mbstore & "' and mbserver = '"&mbserver&"'" , objConnection, adOpenStatic, adLockOptimistic
- '* else
- '* objRecordset.Open "SELECT * FROM MBServers WHERE jobcode = '"&etype & "' and mbserver = '"&mbserver&"'" , objConnection, adOpenStatic, adLockOptimistic
- '* end if
- '* new
- objRecordset.Open "SELECT * FROM MBServers WHERE jobcode = '"&etype & "'" , objConnection, adOpenStatic, adLockOptimistic
- '* Ticket: 243168, CBCAPS0004 end
- '*
- mbstore = StripTrailingWS(objRecordSet.Fields("store"))
- mbstoregrp = StripTrailingWS(objRecordSet.Fields("storagegrp"))
- mbadmingrp = StripTrailingWS(objRecordSet.Fields("admingrp"))
- objRecordset.Close
- objConnection.Close
- Set objRecordset = Nothing
- Set objConnection = Nothing
- Wscript.Echo "End ReadMBServer"
- End Sub
- '*Incident # 6282 cbcaps0033, mej 02/15/2013 add department -- comment out readcaps begin
- '* Ticket: 243168, CBCAPS0004 begin
- 'Sub ReadCAPS_Control(ByVal CAPS_CONTROL_VALUE,capsvaluedesc)
- ' Wscript.Echo "Starting ReadCAPS_Control"
- ' Const adOpenStatic = 3
- ' Const adLockOptimistic = 3
- ' Const adUseClient = 3
- ' DIM objConnection
- ' DIM objRecordset
- '
- ' Set objConnection = CreateObject("ADODB.Connection")
- ' Set objRecordset = CreateObject("ADODB.Recordset")
- ' objConnection.Open "data source='Accounts';"
- ' objRecordset.CursorLocation = adUseClient
- ' objRecordset.Open "Select * from CAPS_Control where CAPS_CONTROL_VALUE = '"&CAPS_CONTROL_VALUE&"'" ', objConnection, adOpenStatic, adLockOptimistic
- ' capsvaluedesc= StripTrailingWS(objRecordSet.Fields("Description"))
- 'wscript.echo "Description "&capsvaluedesc
- ' objRecordset.Close
- ' objConnection.Close
- ' Set objRecordset = Nothing
- ' Set objConnection = Nothing
- ' Wscript.Echo "End ReadCAPS_Control"
- 'End Sub
- '* Ticket: 243168, CBCAPS0004 end
- '*Incident # 6282 cbcaps0033, mej 02/15/2013 add department -- comment out readcaps end
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Sub ReadEU_Group(ByVal lCity,EUGroup)
- Wscript.Echo "Starting ReadEU_Group"
- Const adOpenStatic = 3
- Const adLockOptimistic = 3
- Const adUseClient = 3
- DIM objConnection
- DIM objRecordset
- Set objConnection = CreateObject("ADODB.Connection")
- Set objRecordset = CreateObject("ADODB.Recordset")
- objConnection.Open "data source='Accounts';"
- objRecordset.CursorLocation = adUseClient
- objRecordset.Open "Select * from EUGroup where city = '"&lcity&"'" , objConnection, adOpenStatic, adLockOptimistic
- EUGroup= objRecordSet.Fields("EUGroup")
- wscript.echo "lcity "&lcity
- wscript.echo "EU Group "&EUGroup
- objRecordset.Close
- objConnection.Close
- Set objRecordset = Nothing
- Set objConnection = Nothing
- Wscript.Echo "End ReadEU_Group"
- End Sub
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'Sub CreateNewUser(ByVal alias, ByVal ln, ByVal fn, ByVal MI, ByVal eid, ByVal etype, ByVal cc, objUser, OU, strpw,srv, mbserver, bserver, bstore,emailTo
- Sub CreateNewUser(ByVal alias, ByVal ln, ByVal fn, ByVal MI, ByVal eid, ByVal etype, ByVal cc,ByVal Root_DN,ByVal Emaillongbase, objUser, OU, strpw,srv, mbserver, bserver, bstore,emailTo)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Wscript.Echo "Start CreateNewUser"
- Const ADS_PROPERTY_DELETE = 4
- Const ADS_PROPERTY_APPEND = 3
- DIM objOU
- DIM objGroup
- DIM lcity
- DIM postalcode
- DIM state
- DIM streetaddress
- DIM telephone
- DIM country
- DIM officeName
- DIM strMultiName
- DIM strMultiDName
- DIM title
- DIM intPrimaryGroupToken
- Dim emailAD
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Dim emailbase
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- if (Len(MI) > 0) then
- strMultiName = LN &"\, " &FN &" "&MI
- strMultiDName = LN &", " &FN &" "&MI
- else
- strMultiName = LN &"\, " &FN
- strMultiDName = LN &", " &FN
- end if
- Call ReadCostCenterTable(cc,country,lcity,postalcode,state,streetaddress,telephone,OU,officeName,srv,mbserver,bserver,bstore,emailTo)
- title =GetTitle(etype)
- If OU = "NewUsers" then
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Set objOU = GetObject(Root_DN&"/"&OU)
- 'Set objOU = GetObject("LDAP://cdc-dcciberp4/OU=NewUsers,dc=ciber,dc=CBR,dc=INC")
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Set objUser = objOU.Create("User", "cn="&strMultiName)
- objUser.Put "sAMAccountName", left(alias,20)
- 'objUser.Put "userPrincipalName", alias &"@ciber.cbr.inc"
- objUser.Put "userPrincipalName", alias &emaillongbase
- ' objUser.AccountDisabled = True
- objUser.SetInfo
- else
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- wscript.echo "Root_DN " &Root_DN
- wscript.echo "OU " &OU
- Set objOU = GetObject(Root_DN&"/"&OU)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Set objUser = objOU.Create("User", "cn="&strMultiName)
- objUser.Put "sAMAccountName", left(alias,20)
- objUser.Put "userPrincipalName", alias &emaillongbase '"@ciber.cbr.inc"
- objUser.SetInfo
- objUser.Put "co", country
- objUser.Put "c", country
- objUser.Put "l", lcity
- objUser.Put "postalcode", postalcode
- objUser.Put "streetAddress", streetaddress
- objUser.Put "telephoneNumber", telephone
- objUser.Put "PhysicalDeliveryOfficeName", cc &" - " & officeName
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department begin
- objUser.Put "department", cc &" - " & officeName
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department end
- objUser.Put "company", "CIBER Europe"
- 'objUser.Put "st", state
- objUser.SetInfo
- objUser.AccountDisabled = FALSE
- objUser.SetInfo
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Call ReadEU_Group(lcity,EUGroup)
- wscript.echo "Eu Group " &EUGroup
- wscript.echo "push to group" &Root_DN&"/"&EUGroup
- set objGroup = GetObject(Root_DN&"/"&EUGroup)
- objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- objGroup.SetInfo
- 'if (lcity = "Bunnik") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Bunnik,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "Copenhagen") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Copenhagen,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Eindhoven") then
- ' set objGroup = GetObject(Root_DN&"/CN=.EU Eindhoven,OU=Administrative Lists & Groups,OU=CIBER Europe,DC=ciber,DC=CBR,DC=INC")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "London") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU London,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Nieuwegein") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Nieuwegein,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Oslo") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Oslo,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Oxford") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Oxford,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Stockholm") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Stockholm,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Barnsley") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Barnsley,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Cradley Heath") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Cradley Heath,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Grove Park") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Grove Park,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (cc = "CE0014") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Homeworkers,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Hinkley") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Hinckley,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Billingham") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Billingham,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- ' elseif (lcity = "Heidelberg") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Heidelberg,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "Boeblingen") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Boeblingen,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "Cologne") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Cologne,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Zurich") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Zurich,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Prague") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Prague,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Espoo") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Espoo,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Barcelona") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Barcelona,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Madrid") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Madrid,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Zaragoza") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Zaragoza,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Singapore") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Singapore,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "Shanghai") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Shanghai,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "Harefield") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Harefield,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Langenfeld") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Langenfeld,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Vienna") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Vienna,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'elseif (lcity = "St. Petersburg") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU St. Petersburg,OU=Administrative Lists & Groups,OU=CIBER Europe,DC=ciber,DC=CBR,DC=INC")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Auckland") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Auckland,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Moscow") then
- 'set objGroup = GetObject(Root_DN&"/cn=.EU Moscow,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- 'objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "Melbourne") then
- 'set objGroup = GetObject(Root_DN&"/cn=.EU Melbourne,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- 'objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- 'elseif (lcity = "North Sydney") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Sydney,OU=Administrative Lists & Groups,OU=CIBER Europe,dc=ciber,dc=cbr,dc=inc")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'Call# : 46332 (Modify CIBER Europe New Hire account script)
- 'Modified on : 4/5/2006
- 'Modified by : Ashok Gopalan
- 'Notes : Add users belonging to Amsterdam to the corresponding distribution group.
- ' elseif (lcity = "Amsterdam") then
- ' set objGroup = GetObject(Root_DN&"/cn=.EU Amsterdam,OU=Administrative Lists & Groups,OU=CIBER Europe,DC=ciber,DC=CBR,DC=INC")
- ' objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- ' objGroup.SetInfo
- 'else
- 'end if
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- if (cc <> "04149") then
- Call ReadEU_Group("Europe",EUGroup)
- wscript.echo "Eu Group " &EUGroup
- set objGroup = GetObject(Root_DN&"/"&EUGroup)
- 'set objGroup = GetObject("&Root_DN&"/cn=CS CIBER Europe,cn=Users,dc=ciber,dc=cbr,dc=inc")
- objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- objGroup.SetInfo
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'set objGroup = GetObject(Root_DN&"/cn=CS CIBER Europe,cn=Users,dc=ciber,dc=cbr,dc=inc")
- 'objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- end if
- 'Removed by Al -- See Call # 35106
- 'Set objGroup = GetObject(Root_DN&"/cn=CSP AllEmps,cn=Users,dc=ciber,dc=cbr,dc=inc")
- 'objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(objuser.Get("distinguishedName"))
- 'objGroup.SetInfo
- Set objGroup = Nothing
- end if
- strpw = CreatePassword(eid,cc)
- Wscript.Echo eid
- Wscript.Echo etype
- Wscript.Echo ln
- Wscript.Echo fn
- Wscript.Echo strMultiDName
- objUser.EmployeeID = eid
- objUser.EmployeeType = etype
- objUser.LastName = ln
- objUser.FirstName = fn
- if (Len(mi) > 0) then
- objUser.Put "initials", left(mi,1)
- end if
- objUser.DisplayName = strMultiDName
- objUser.Description = eid & " - " & title
- objUser.SetPassword strpw
- objUser.SetInfo
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'emailad = alias & ".ciber.com"
- emailad = alias & emailbase
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Call UpdateHeatProfile(eid,fn,ln,telephone,(cc &" - " & officeName),emailad,alias,etype,(eid & " - " & title))
- set objGroup = Nothing
- set objOU = Nothing
- Wscript.Echo "End CreateNewUser"
- End Sub
- '* Subroutine UpdateHeatProfile--Subroutine to create the users in the Heat Help Desk System
- '*
- '* Input:
- '* Empid--employee ID, string
- '* firstname--firstname, string
- '* lastname--lastname, string
- '* phone--Office phone, string
- '* Department--PhyicalOfficeDeliveryName, string
- '* EmailID--email address, string
- '* Logon--username, string
- '* JobCode--employeeType, string
- '* Description--Description, string
- '*
- '* Added: June 9, 2005, by Jeffrey Lathrop
- Sub UpdateHeatProfile(byVal empid, byVal firstname,byVal lastname,byVal phone, byVal department, byVal EmailID,byVal Logon, byVal JobCode, byVal Description)
- wscript.echo "Start UpdateHeatProfile"
- Dim vbquote
- Dim costcenter
- Dim jobclass
- Dim strDate
- Dim strTime
- Dim SLAClass
- Dim hSqlConn
- Dim hSqlCommand
- yy = Year(Date)
- mm = Month(date)
- dd = Day(date)
- If (mm < 10) Then
- mm = "0" &mm
- End If
- If (dd < 10) Then
- dd = "0"&dd
- End If
- strdate = yy&"-"&mm&"-"&dd
- strtime = time
- '* Ticket: 243168, CBCAPS0004 trim am/pm for heat begin
- strtime = left(strtime,8)
- '* Ticket: 243168, CBCAPS0004 end
- costcenter = left(department,2)
- jobclass = Mid(jobcode, 2,1)
- vbquote = chr(34)
- If (((costcenter = "08") or (costcenter = "03")) and (jobclass = "11")) Then
- SLAClass = "Silver"
- elseif ((jobclass <> "11") and (jobclass <> "17")) then
- SLAClass = "Silver"
- else
- SLAClass = "Bronze"
- End If
- Set hSqlConn = CreateObject("ADODB.Connection")
- hSQLConn.Open "data source='Heat Live';"
- Set hSqlCommand = CreateObject("ADODB.Command")
- hSqlCommand.ActiveConnection = hSqlConn
- hSqlCommand.CommandText = ("Select * from Profile where custid = '"&empid&"'")
- set objRecordSet = hSqlCommand.Execute
- If objRecordSet.EOF Then
- hSqlCommand.CommandText = ("Set Quoted_Identifier OFF Insert into Profile (CustID, CustType,FirstName,LastName,Phone,Department,EmailID,Modby,ModDate,ModTime,SLAClass,RecvdDate,RecvdTime,Login,JobCode,Description) " _
- &"Values('"&empid &"','Employee',"&vbquote&firstName&vbquote&","&vbquote&LastName&vbquote&","&vbquote&phone&vbquote&",'" _
- &Department&"',"&vbquote&EmailID&vbquote&",'Accountscript','"&strdate&"','"&strtime&"','"&SLAClass&"','"&strdate&"','"&strtime&"',"&vbquote&Logon&vbquote&",'"&Jobcode&"','"&description&"')")
- hSqlCommand.Execute
- End If
- wscript.echo "End UpdateHeatProfile"
- End Sub
- Sub CreateMailBox(ByVal aliasNB, ByVal aliasB, ByVal cc, ByVal etype, objUser, cmbServer, cmbStore)
- WScript.Echo "Start CreateMailBox"
- DIM cmsrv, cmstore, cmstoregrp,cmadmingrp
- DIM cdPerson
- set cdPerson = CreateObject("CDO.Person")
- set cdPerson = objuser
- cdPerson.MailEnable aliasB
- cdPerson.SetInfo
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' cdPerson.Put "proxyAddresses", Array("smtp:"&aliasNB&emailbase"@ciber.com","SMTP:"&aliasB)
- cdPerson.Put "proxyAddresses", Array("smtp:"&aliasNB&emailbase,"SMTP:"&aliasB)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- cdPerson.SetInfo
- set cdPerson = Nothing
- Wscript.Echo "End CreateMailBox"
- End Sub
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls begin
- '* new emailadmin routine
- Sub EmailAdmin(ByVAl emailext, ByVal aliasB, ByVal ln, ByVal fn, ByVal mi, ByVal eid, ByVal etype, ByVal cc, ByVal strpwd, ByVal mbserver, ByVal emailto,ByVal FQDN, ByVal Root_DN, ByVal EmailFromStatic, ByVal EmailToStatic, ByVal EmailServer, ByVal EmailBase)
- Wscript.Echo "Start EmailAdmin"
- Dim messageBody
- Dim messageBody1
- Dim messageBody2
- Dim strCBRSP
- messagebody1 = "WELCOME TO Ciber" & VbCrLF
- messagebody1 = messagebody1 & "The Ciber Service Desk would like to take this opportunity to welcome you to Ciber. "
- messagebody1 = messagebody1 & "At this time we encourage you to take advantage of the IS related services, which we offer." & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Ciber NETWORK ACCESS:" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Ciberspace username: " & aliasB &VbCrLF
- messagebody1 = messagebody1 & vbTab & "Ciberspace password: " & strpwd &VbCrLF
- messagebody1 = messagebody1 & vbTab & "Email Address: " &aliasB & "@Ciber.com" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Forwarded Email Address: " & emailext & VbCrLF & VBCrLF
- messagebody1 = messagebody1 & "Ciber Europe IT Security Handbook:" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Ciber Europe IT Security Handbook" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "URL: https://Ciberspace.Ciber.com/sites/europe/All%20Knowledge/IT%20Security%20Handbook.aspx" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Ciberspace: " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Ciberspace URL: http://Ciberspace.Ciber.com" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Once you login to Ciberspace, you will find Links for enterprise applications under 'System Links'. " & VbCrLF
- messagebody1 = messagebody1 & "Password Self Service: " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Password Self Service URL: https://password.ciber.com " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Your password will expire every 90 days. In order to not lose access to Ciber resources please change your password before the 90 day expiration. In addition, you will " & VbCrLF
- messagebody1 = messagebody1 & "receive an email from the Ciber Service Desk 14 days prior to the network account password expiration, to ensure that you are alerted of the necessary password change requirement. " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Enroll in Password Self-Service: " & VbCrLF
- messagebody1 = messagebody1 & "Login with your Ciber-COM account and begin the enrollment process. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "1. Click on the link: https://password.ciber.com. (Site can be accessed from Outside of Ciberspace.) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "2. Enter your Ciber-COM username and password, same as Ciberspace. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "3. Select your questions and answers. Don't forget your answers, they are CASE sensitive! These same questions will be asked each time you access the site to reset your password. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "4. If you happen to forget your answers then you can always log in and select your questions and answers again, as long as your password hasn't expired. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "5. Once you are enrolled you will receive notices informing you that your password is going to expire within 14 days of the 90 day deadline. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "6. You may go in and change your Question and Answers at any time as long as your password is still valid. " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Change Password: " & VbCrLF
- messagebody1 = messagebody1 & "To reset your Ciber password, simply follow these steps. (Note: Users must be enrolled before they can reset their passwords) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "1. Click on the link: https://password.ciber.com. Site can be access from outside of Ciberspace. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "2. Click on the RESET YOUR PASSWORD link. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "3. Enter your domain user name. This is the user name that is used for Ciberspace. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "4. Answer the questions chosen at the time of enrollment. Remember your answers are CASE sensitive and you need to answer the question the same way that it was typed in. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "5. (If your answers do not take and your password hasn't expired. Then go back to the enrollment instructions and re-enter new Questions and Answers.) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "6. Must enter in the Word Verification at the bottom of page. (This is to ensure that the response isn't computer generated. " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "7. Enter your new password based on the following password requirements. (Note: The complexity requirements are not displayed in detail on the site at this time) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & "a. Password must not contain the user's account name or parts of the user's full name that exceed two consecutive characters " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & "b. Must be at least eight (8) characters in length " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & "c. Must contain characters from at least three of the following four categories: " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & vbTab & "English uppercase characters (A through Z) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & vbTab & "English lowercase characters (a through z) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & vbTab & "Base 10 digits (0 through 9) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & vbTab & vbTab & "Non-alphabetic characters (such as !, $, #, %, *) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "8. Once again enter in the Word Verification at the bottom of the page. (This is to ensure that the response isn't computer generated.) " & VbCrLF
- messagebody1 = messagebody1 & vbTab & "9. Click RESET PASSWORD " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Ciber Service Desk - Hours of Operation: " & VbCrLF
- messagebody1 = messagebody1 & "The Service Desk hours are 24 hours Monday through Friday. You can contact the Service Desk by emailing support@ciber.com or calling the following numbers: " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Europe - 00800 3000 5566 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "India - +91 80 6699 0555 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Australia - 180 007 3072 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "New Zealand - 800 448 869. " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Voice mail is available after hours. " & VbCrLF
- messagebody1 = messagebody1 & "Sincerely, " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Ciber Service Desk " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Hours: Mon-Fri 24 hours " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Toll Free (US) - (888) 773-2778 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Europe - 00800 3000 5566 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "India - +91 80 6699 0555 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Australia - 180 007 3072 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "New Zealand - 800 448 869 " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Email - Support@ciber.com " & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Ciberspace Site - https://ciberspace.ciber.com/sites/IS/ " & VbCrLF
- messagebody = messageBody1
- Set objEmail = CreateObject("CDO.Message")
- objEmail.From = EmailFromStatic
- objEmail.To = emailto &";"&emailtostatic
- objEmail.Subject = "New User Information: " & ln & ", " & fn
- objEmail.Textbody = messageBody
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = emailserver
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
- objEmail.Configuration.Fields.Update
- objEmail.Send
- Wscript.Echo "End EmailAdmin"
- End Sub
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls end new sub emailadmin
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls begin rename old emailadmin routine
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'Sub EmailAdmin(aliasNB, aliasB, ln, fn, mi, eid, etype, cc,strpwd, mbserver,emailto)
- 'Sub EmailAdmin(aliasNB, aliasB, ln, fn, mi, eid, etype, cc,strpwd, mbserver,emailto,emailserver)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Sub EmailAdmin_11052013(ByVAl aliasNB, ByVal aliasB, ByVal ln, ByVal fn, ByVal mi, ByVal eid, ByVal etype, ByVal cc, ByVal strpwd, ByVal mbserver, ByVal emailto,ByVal FQDN, ByVal Root_DN, ByVal EmailFromStatic, ByVal EmailToStatic, ByVal EmailServer, ByVal EmailBase)
- Wscript.Echo "Start EmailAdmin"
- Dim messageBody
- Dim messageBody1
- Dim messageBody2
- Dim strCBRSP
- messagebody1 = "WELCOME TO CIBER" & VbCrLF
- messagebody1 = messagebody1 & "The CIBER Help Desk would like to take this opportunity to welcome you to CIBER. "
- messagebody1 = messagebody1 & "At this time we encourage you to take advantage of the IS related services, which we offer." & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "The password below will expire after 90 days" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "PASSWORD REQUIREMENTS:" & VbCrLF
- messagebody1 = messagebody1 & "Password needs to be at least eight characters; Has not been used in the previous four passwords; Does not contain your account or full name; Contains at least three of the four character groups:" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "English uppercase characters (A through Z)" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "English lowercase characters (a through z)" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Numerals (0 through 9)" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "Non-alphabetic characters (such as !, $, #, %, *)" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Your Username and Password will give you access to the following resources where you will find link to 'Change Password'." & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "CIBER NETWORK ACCESS:" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "CIBERspace username: " & aliasNB &VbCrLF
- messagebody1 = messagebody1 & vbTab & "CIBERspace password: " & strpwd &VbCrLF
- messagebody1 = messagebody1 & vbTab & "Email Address: " &aliasNB & "@ciber.com" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "Forwarded Email Address: " & aliasB & VbCrLF & VBCrLF
- strCBRsp = "CIBERSPACE: " & VbCrLF
- strCBRsp = strCBRsp & vbTab & "CIBERspace URL: http://ciberspace.ciber.com" & VbCrLF & VbCrLF
- messagebody1 = messagebody1 & "CIBER Europe IT Security Handbook:" & VbCrLF
- messagebody1 = messagebody1 & vbTab & "CIBER Europe IT Security Handbook URL: https://ciberspace.ciber.com/sites/europe/All%20Knowledge/IT%20Security%20Handbook.aspx" & VbCrLF & VbCrLF
- messagebody2 = messagebody2 & "CIBER Help Desk - Hours of Operation:" & VbCrLF
- messagebody2 = messagebody2 & "The Help Desk hours are 6:00 a.m. Mountain time to 6:00 p.m. Mountain time. You can contact the Help Desk at 1-888-773-2778 or submit a support request at https://helpdesk.ciber.com. Voice mail is available after hours." & VbCrLF
- messagebody2 = messagebody2 & "In the case of a site emergency, the On-Call pager number is 303-807-9787." & VbCrLF & VbCrLF
- messagebody2 = messagebody2 & "Your password will expire every 90 days. In order not to lose access to CIBER IS resources please change your password before the 90 day expiration. "
- 'check if this a subcontractor with CC in the format "x17xxx"
- if (Len(cc) >= 3) then
- if (Mid(cc, 2, 2) <> "17") then
- messagebody2 = messagebody2 & "In addition, you will receive an email from the CIBER Help Desk, 14 days prior to the network account password expiration, to ensure that you are alerted of the necessary password change requirement. "
- end if
- end if
- messagebody2 = messagebody2 & VbCrLF & VbCrLF & "CIBER Help Desk" & VbCrLF
- messagebody2 = messagebody2 & "PH: 888-773-2778" & VbCrLF
- messagebody2 = messagebody2 & "E-Mail: helpdesk@ciber.com" & VbCrLF
- messagebody2 = messagebody2 & "Web: https://helpdesk.ciber.com" & VbCrLF
- messagebody = messageBody1 & strCBRsp & messageBody2
- Set objEmail = CreateObject("CDO.Message")
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' objEmail.From = "HelpDesk@ciber.com"
- objEmail.From = EmailFromStatic
- ' objEmail.To = emailto &";new_accounts@ciber.com"
- objEmail.To = emailto &";"&emailtostatic
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- objEmail.Subject = "New User Information: " & ln & ", " & fn
- objEmail.Textbody = messageBody
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.ciber.com"
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = emailserver
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
- objEmail.Configuration.Fields.Update
- objEmail.Send
- Wscript.Echo "End EmailAdmin"
- End Sub
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls end rename emailadmin routine
- Sub EmailAdmin_old(aliasNB, aliasB, ln, fn, mi, eid, etype, cc,strpwd, mbserver,emailto)
- Wscript.Echo "Start EmailAdmin"
- DIM messageBody
- DIM messageBody1
- DIM messageBody2
- DIM messageBody3
- DIM messageBody4
- DIM messageBody5
- DIM strCBRSP
- DIM strCHpt
- DIM strOWA
- DIM strusrnm
- DIM strusrpw
- messagebody1 = "Welcome To CIBER" &VbCrLF &"The CIBER Help Desk would like to take this opportunity to welcome you to CIBER."
- messagebody2 = " At this time we encourage you to take advantage of the IT related services, which we offer. Your UserName and Password will give you access to the following resources." &VbCrLF &VbCrLF
- messagebody3 = "CIBER NETWORK:" &VbCrLF &VbCrLF &"CIBERspace username: "
- messagebody4 = aliasNB &VbCrLF
- messagebody5 = "CIBERspace password: " &strpwd &VbCrLF
- messagebody6 = "Email Address: " &aliasNB &"@ciber.com" &VbCrLF&VbCrLF
- messagebody7 = "Forwarded Email Address: " &aliasB &VbCrLF
- strCBRsp = VBCrLF & "CIBERSPACE: " &VbCrLF &VbCrLF &" CIBERspace URL: https://ciberspace.ciber.com" &VbCrLF
- strhd1 = VbCrLF & "CIBER Help Desk:" &VbCrLF &VbCrLF &"The Help Desk hours are 6:00 a.m. Mountain time to 6:00 p.m. Mountain time. You can contact the Help Desk at 1-888-773-2778 or send an email to helpdesk@ciber.com. Voice mail is available after hours." &VbCrLF &VbCrLF
- strhd2 = "In the case of a site emergency, the On-Call pager number is 303-609-7577." &VbCrLF &VbCrLF &"CIBER Help Desk" &VbCrLF &"PH: 888-773-2778" &VbCrLF &"E-Mail: helpdesk@ciber.com"
- messagebody = messageBody1 & messagebody2 &messagebody3 & messagebody4 & messagebody5 &messagebody6 &messagebody7 &strCBRsp &strhd1 &strhd2
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Emailstore = emailto &";"&emailtostatic
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Set objEmail = CreateObject("CDO.Message")
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'objEmail.From = "HelpDesk@ciber.com"
- objEmail.From = EmailFromStatic
- 'objEmail.To = emailto &";new_accounts@ciber.com;" &aliasB
- objEmail.To = emailto &";"&emailtostatic &aliasB
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- objEmail.Subject = "New User Information: " & ln &", " &fn
- objEmail.Textbody = messageBody
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.ciber.com"
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = emailserver
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
- objEmail.Configuration.Fields.Update
- objEmail.Send
- Wscript.Echo "End EmailAdmin"
- End Sub
- Sub WriteLog(aliasNB, aliasB,ln,fn,mi, eid, etype, cc,strpwd, OU,StatusB, StatusNB)
- WScript.Echo "Start WriteLog"
- Const ForAppending = 8
- DIM Outfso
- DIM Myfout
- '* Create Files System Object for writing output to file append
- Set Outfso = CreateObject("Scripting.FileSystemObject")
- Set Myfout = OutFSO.OpenTextFile("c:\newaccounts.txt", ForAppending)
- if (StatusNB <> "Name too Long") then
- if (StatusNB = "OK") then
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' Myfout.Writeline aliasNB &"," &aliasB &"," &strpwd&","&cc&","&etype&"," &eid &","&aliasNB&"@ciber.com,Created in this OU: "&OU
- Myfout.Writeline aliasNB &"," &aliasB &"," &strpwd&","&cc&","&etype&"," &eid &","&aliasNB&emailbase&",Created in this OU: "&OU
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Wscript.Echo aliasNB &"," &aliasB &"," &strpwd&","&cc&","&etype&"," &eid &",Created in this OU: "&OU
- else
- Myfout.Writeline Ln &"," &fn & ",,,"&eid &",User already exists"
- Wscript.Echo Ln &"," &fn & ",,,"&eid &",User already exists"
- end if
- else
- Myfout.Writeline Ln &"," &fn & ",," &cc &","&etype&","&eid &",Name too Long"
- Wscript.Echo Ln &"," &fn & ",," &cc &","&etype&","&eid &",Name too Long"
- End if
- Myfout.Close
- set Myfout = Nothing
- set Outfso = Nothing
- Wscript.Echo "End WriteLog"
- End Sub
- Sub Main()
- '* Variable Listing
- '*Const ADS_GROUP_TYPE_GLOBAL_GROUP = &h2
- '*Const ADS_GROUP_TYPE_LOCAL_GROUP = &h4
- '*Const ADS_GROUP_TYPE_UNIVERSAL_GROUP = &h8
- '*Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department begin
- '* note use include sub routine
- '* note use full path for SSIS package runs
- includeFile "CB_Read_CAPS_Control.vbs"
- includeFile "CB_Read_CAPS_EmailControl.vbs"
- includeFile "CB_Send_CAPS_Email.vbs"
- '*includeFile "D:\Adscripts\CB_Read_CAPS_Control.vbs"
- '*includeFile "D:\Adscripts\CB_Read_CAPS_EmailControl.vbs"
- '*includeFile "D:\Adscripts\CB_Send_CAPS_Email.vbs"
- '* Incident # 6282 cbcaps0033, mej 02/15/2013 add department end
- Const ADS_UF_ACCOUNTDISABLE = 2
- Const ADS_CHASE_REFERRALS_SUBORDINATE = &h20
- DIM vbQuote '* Double Quote Character
- DIM fso '* File system object
- DIM MyFile '* Program Instance of FSO to write data out to
- DIM MyFile2
- DIM objConnection '* Active Directory connection
- DIM objCommand '* Search Command
- DIM objRecordSet '* Returned records
- DIM objUser '* User record information structure
- DIM strdept '* string Department
- DIM cc '* cost center
- DIM ln '* last name
- DIM fn '* first name
- DIM mi '* middle initials
- DIM eid '* employee ID
- DIM etype '* employee Type
- DIM aliasNB '* NonBillable alias
- DIM aliasB '* Billable Alias
- DIM OU '* Organizational unit
- DIM strpw '* Security authorization container
- DIM arrServiceList '* Array of Parsed information
- DIM Server '* Branch Server
- DIM mbserver '* NonBillable Mailserver
- DIM bserver '* Billable Mailserver
- DIM bstore '* Billable Store
- DIM emailto '* admins to mail information to
- DIM StatusB
- DIM StatusNB
- DIM jobtype1
- DIM jobtype2
- DIM alias1, alias2
- DIM status1, status2
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- Dim FQDN, Root_DN
- Dim EmailToStatic, EmailToStatic2, EmailFromStatic, EmailBase, EmailLongBase, EmailServer, group_base
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls begin
- Dim Region, MailType, LookupErr, MaxTries, MaxCount
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls end
- call ReadCAPS_Control("group_base",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- group_base = capsvaluedesc
- '******************
- call ReadCAPS_Control("EmailToStatic",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailToStatic = capsvaluedesc
- wscript.echo " EmailToStatic " &EmailToStatic
- '****
- call ReadCAPS_Control("EmailToStatic2",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailToStatic2 = capsvaluedesc
- wscript.echo " EmailToStatic2 " &EmailToStatic2
- '****
- call ReadCAPS_Control("EmailFromStatic",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailFromStatic = capsvaluedesc
- wscript.echo " EmailFromStatic " &EmailFromStatic
- '****
- call ReadCAPS_Control("EmailBase",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailBase = capsvaluedesc
- wscript.echo " EmailBase " &EmailBase
- '****
- call ReadCAPS_Control("EmailLongBase",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailLongBase = capsvaluedesc
- wscript.echo " EmailLongBase " &EmailLongBase
- '****
- call ReadCAPS_Control("EmailServer",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- EmailServer = capsvaluedesc
- wscript.echo " EmailServer " &EmailServer
- '****
- call ReadCAPS_Control("FQDN",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- FQDN = capsvaluedesc
- call ReadCAPS_Control("ROOTDN",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- Root_DN = capsvaluedesc
- Call ReadCAPS_Control("FQDN_Base",capsvaluedesc)
- wscript.echo "capsvaluedesc " &capsvaluedesc
- FQDN_Base = capsvaluedesc
- wscript.echo " fqdn_base " &FQDN_Base
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- '* Variable Initialization
- vbQuote = Chr(34)
- strdept = ""
- cc = ""
- ln = ""
- if (Wscript.Arguments.Count > 0) then
- Call CreateNewHiresFile(Wscript.Arguments.Item(0))
- end if
- '* Create Files System Object for writing output to file
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set MyFile = FSO.OpenTextFile("c:\eunewhires.txt", 1)
- Wscript.Echo "UserAccount script started:"
- MyFile.ReadLine
- Do Until MyFile.AtEndOfStream
- strNextLine = MyFile.ReadLine
- strNextLine = trim(strNextLine)
- if (strNextLine <> "")Then
- arrServiceList = Split(strNextLine , chr(9))
- cc=arrServiceList(0)
- ln=arrServiceList(1)
- fn=arrServiceList(2)
- mi=arrServiceList(3)
- eid=arrServiceList(4)
- etype=arrServiceList(5)
- aliasB=arrServiceList(6)
- emailext=arrServiceList(7)
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide begin
- emailoveride=arrServiceList(8)
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide end
- status1 = ""
- status2 = ""
- alias1 = ""
- alias2 = ""
- ' if ((len(ln)+len(fn)+1) <= 20) then
- Wscript.Echo " Processing New User:" & strNextLine
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' Call CheckAlias(ln,fn,mi,eid,etype,jobtype1,aliasb,status1)
- Call CheckAlias(ln,fn,mi,eid,etype,jobtype1,group_base,FQDN,Root_DN,EmailBase,aliasb,status1)
- StatusNB = Status1
- StatusB = Status1
- if (StatusNB <> "Account Already Exists" ) then
- ' Call CreateNewUser(aliasB, ln, fn, mi, eid, etype, cc, objUser, OU, strpw, Server,mbserver, bserver, bstore, emailto)
- Call CreateNewUser(aliasB, ln, fn, mi, eid, etype, cc, Root_DN,emaillongbase,objUser, OU, strpw, Server,mbserver, bserver, bstore, emailto)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- '* Ticket: 243168, CBCAPS0004 -- begin
- '* old Call to create email with exchange 2003
- '* Call CreateMailBox(aliasB,emailext ,cc, etype, objUser, mbserver, bstore)
- gUsername = aliasB
- ' gEmail = guserName & "@CIBER.CBR.INC"
- gEmail = guserName & emaillongbase
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- ' # Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls add new variables begin
- call ReadCAPS_Control("MaxCount",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- MaxCount = capsvaluedesc
- call ReadCAPS_Control("MaxTries",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- MaxTries = capsvaluedesc
- 'call ReadCAPS_Control("MailType",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- 'MailType = capsvaluedesc
- call ReadCAPS_Control("MailType1",capsvaluedesc)
- wscript.echo "MailType1 " &capsvaluedesc
- MailType = capsvaluedesc
- 'call ReadCAPS_Control("MailType2",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- 'MailType = capsvaluedesc
- 'call ReadCAPS_Control("Region",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- 'Region = capsvaluedesc
- call ReadCAPS_Control("Region1",capsvaluedesc)
- wscript.echo "Region " &capsvaluedesc
- Region = capsvaluedesc
- call ReadCAPS_Control("LookupErr",capsvaluedesc)
- wscript.echo "LookupErr " &capsvaluedesc
- LookupErr = capsvaluedesc
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls add new variables end
- call ReadCAPS_Control("mailerrorlog",capsvaluedesc)
- wscript.echo "mailerrorlog " &capsvaluedesc
- maillog = capsvaluedesc
- Set objShell = CreateObject("Wscript.Shell")
- 'NewEmailScriptName = "c:\adscripts\Enable_ExternalMailUser.ps1"
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls begin
- 'call ReadCAPS_Control("mailuserscript",capsvaluedesc)
- call ReadCAPS_Control("mailboxscript",capsvaluedesc)
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls end
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- NewEmailScriptName = capsvaluedesc
- gEmail1 = " -principalname " &gemail
- mbserver1 = " -mbserver " &mbserver
- storegrp1 = " -mbdb " &storegrp1
- bstore1 = " -bstore " &bstore1
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide begin
- if instr(emailext,"@") > 0 and mailtype = "Mailbox" then
- emailext = left(emailext,(instr(emailext,"@")-1))
- End if
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide end
- emailext1 = " -emaddress " &emailext
- maillog1 = " -emaillog " &maillog
- FQDN_Base1 = " -DomainController "&FQDN_Base
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls set new variables begin
- Regions = " -Region "&Region
- MaxCount1 = " -MaxCount "&MaxCount
- MaxTries1 = " -MaxTries "&MaxTries
- MailType1 = " -MailType "&MailType
- LookupErr1 = " -LookupErr "&LookupErr
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide begin
- If EmailOveride = "Y" and mailtype = "Mailbox" then
- alias1 = " -alias "&emailext
- else
- alias1 = " -alias "&aliasB
- End if
- If mailtype = "MailUser" then
- alias1 = " -alias "&aliasB
- End if
- '* Incident #91305 cbcaps0048, mej 10/31/2014 allow email overide end
- ' prior call
- ' alias1 = " -alias "&aliasB
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls set new variables end
- 'MBServer=Tdc-exmbt2
- 'Store=100mb
- 'StorageGRP=tdc-100mb
- 'Wscript.Echo "gma:" & gEmail1
- 'Wscript.Echo "mbserver1:" & mbserver1
- 'Wscript.Echo "storegrp1:" & storegrp1
- 'Wscript.Echo "bstore1:" & bstore1
- 'Wscript.Echo "mbserver1:" & mbserver1
- 'Posh= "C:\windows\system32\WindowsPowerShell\v1.0\PowerShell.exe "
- call ReadCAPS_Control("poshexe",capsvaluedesc)
- 'wscript.echo "capsvaluedesc " &capsvaluedesc
- Posh = capsvaluedesc
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- 'PoshLaunch=Posh & " "&NewEmailScriptName &gEmail1 &" " &emailext &" " &maillog &" "
- 'PoshLaunch=Posh & " "&NewEmailScriptName &gEmail1 &" " &emailext1 &" " &maillog1 &" " &FQDN_Base1 &" "
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls add new variables begin
- 'PoshLaunch=Posh & " "&NewEmailScriptName &gEmail1 &mbserver1 &storegrp1 &bstore1 &FQDN_Base1 &" "
- PoshLaunch=Posh & " "&NewEmailScriptName &gEmail1 &emailext1 &emaillog1 &FQDN_Base1 &Regions &MaxCount1 &MaxTries1 &MailType1 &LookupErr1 &alias1 &" "
- '* Incident # 5937 cbcaps0030, mej 11/05/2013 use exchange 2010 calls add new variables end
- Wscript.Echo "launch file:" & PoshLaunch
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- return=objShell.Run (PoshLaunch, 1, true)
- 'objShell.Run PoshLaunch
- '*
- '* Ticket: 243168, CBCAPS0004 -- end
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 begin
- ' Call EmailAdmin(aliasB, emailext,ln,fn,mi, eid, etype, cc,strpw, mbserver, emailto)
- ' Call EmailAdmin(aliasB, emailext,ln,fn,mi, eid, etype, cc,strpw, mbserver, emailto,emailserver)
- '* Ticket # 274098 cbcaps0016, mej 02/15/2012 end
- Call EmailAdmin(emailext, aliasB,ln,fn,mi, eid, etype, cc,strpw, bserver, emailto,FQDN,Root_DN,emailfromstatic,emailtostatic,emailserver,emailbase)
- end if
- ' else
- ' StatusNB = "Name too Long"
- ' StatusB = "Name too Long"
- 'end if
- Call WriteLog(aliasB, aliasB,ln,fn,mi, eid, etype, cc,strpw, OU,StatusB, StatusNB)
- End If
- StatusNB = ""
- StatusB = ""
- Loop
- Wscript.Echo "UserAccount script ended."
- MyFile.Close
- end Sub
Add Comment
Please, Sign In to add comment