'Version 1.5 10/13/06 - Added McAfee install process for remote users lines 21 - 53 'Version 1.3 4/26/2006 wr-by Chuck Arconi 'If you modify this file note it at the top along with your name On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") '*********call printer update script********** 'Set WshShell = WScript.CreateObject("WScript.Shell") 'WshShell.Run "RenamePrintQueuesV4.vbs" '********* determine OS and quit if it's a server ********* Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems Select Case objOperatingSystem.Caption Case "Microsoft(R) Windows(R) Server 2003, Standard Edition" WScript.Quit Case "Microsoft(R) Windows(R) Server 2003, Enterprise Edition" WScript.Quit Case "Microsoft Windows 2000 Server" WScript.Quit End Select Next Set objSysInfo = CreateObject("ADSystemInfo") Set objNetwork = CreateObject("Wscript.Network") strUserPath = "LDAP://" & objSysInfo.UserName Set objUser = GetObject(strUserPath) '********** map drives based on group membership ********* For Each strGroup in objUser.MemberOf strGroupPath = "LDAP://" & strGroup Set objGroup = GetObject(strGroupPath) strGroupName = objGroup.CN 'WScript.Echo strGroupName Select Case strGroupName Case "740Bay" objNetwork.MapNetworkDrive "H:", "\\yourServer\path\path\"_ & objNetwork.UserName Case "3355Edison" objNetwork.MapNetworkDrive "H:", "\\yourServer\path\path\"_ & objNetwork.UserName Case "Information Technology" objNetwork.MapNetworkDrive "G:", "\\yourServer\path\path" 'Case "QAD Users" ' j=1 ' Call JRE End Select Next objNetwork.MapNetworkDrive "I:", "\\yourServer\path\path" objNetwork.MapNetworkDrive "K:", "\\yourServer\path\path" objNetwork.MapNetworkDrive "Q:", "\\yourServer\path\path" objNetwork.MapNetworkDrive "R:", "\\yourServer\path\path" '********* set system time ********* WshShell.Run "net Time \\ds10001 /Set /yes > nul" '********* check for anti-virus and notify IT if missing ********* Set colProcesses = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'FrameworkService.exe'") Set objComputer = CreateObject("Shell.LocalMachine") Set objShell = CreateObject("WScript.Shell") If colProcesses.Count = 0 Then subject = "Anti-virus is not running on "& objComputer.MachineName textbd = "Anti-virus is not running on "& objComputer.MachineName Call SmtpServer End If '**********Call scripts or programs outside of this script- change the line after "WshShell.Run" to the program to call ********************* 'Set WshShell = WScript.CreateObject("WScript.Shell") 'WshShell.Run "DfltDelSetv3.vbs" '********** email information *********** 'Place any routine above this sub-routine and have it "CALL" SmtpServer 'Then pass the 2 varibles, subject (subject line of the email) and textbd (message text) Sub SmtpServer Set objEmail = CreateObject("CDO.Message") objEmail.From = "LogonScript@yourcompany.com" objEmail.To = "helpdesk@yourcompany.com" objEmail.Subject = subject objEmail.Textbody = textbd objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ "yourEmailServer" objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objEmail.Configuration.Fields.Update objEmail.Send End Sub