1. Exclude running this on servers 2. Greetings not working properly 3. Need to change local Admin password 4. Check for TrendMicro if not exist install 5. If Trend does exist update to latest definition
;delete any old drive shares ;*********************************************************** Use * /delete ;*********************************************************** ; Displaying Logon Info Screen ;*********************************************************** ; Determine password expiration DATE $PWDEXPIRE = @MAXPWAGE - @PWAGE $PWDEXPIRE=IIF($PWDEXPIRE <=0,"Your password has no expiration date.","Your current password will expire in "+$PWDEXPIRE+" day(s).")
; Determine time of day $TIME = @TIME Select CASE $TIME > "00:000:01" AND $TIME < "12:00:00" $TOD = "Good morning" CASE $TIME > "11:59:59" AND $TIME < "18:00:00" $TOD = "Good afternoon" CASE $TIME > "17:59:59" AND $TIME < "24:00:00" $TOD = "Good evening" CASE 1 $TOD = "Welcome" EndSelect
; Information Box Color B/N Box ( 4, 8, 23, 69, Å ) ; shadow Color B+/N Box ( 3, 7, 22, 68, FULL ) ; Box
;Display Banner Color r+/n At (1,2) $title At (2,10)$TOD + @USERID + " to " + @DOMAIN + " Domain." ;At (2,10)$TOD + ", " + @FULLNAME + " to " + $Domain + " Domain." Color w/n At (6,10) "* Date:" At (7,10) "* Time:" At (8,10) "* user:" At (9,10) "* workstation:" At (10,10)"* logon server:" At (11,10)"* domain:" At (12,10)"* IP Address:" At (13,10) "* OS:" At (14,10) "* Service Pack:" At (15,10) "* Setting Workstation time:"
Color w+/n At (6,39) @DAY + " " + @MDAYNO + " " + @MONTH + " " + @YEAR At (7,39) @TIME At (8,39) @USERID + " (" + @FULLNAME + ")" At (9,39) @WKSTA At (10,39) @LSERVER At (11,39) @DOMAIN At (12,39) @IPADDRESS0 At (13,39) @PRODUCTTYPE At (14,39) @CSD Color g+/n At (15,39) "done" SetTime "\\CHIDC1001" Color r+/n At (19,15) $PWDEXPIRE
Sleep 2 Cls
$Caption = "Connecting shares" $Comment = "Connecting Drive Mappings to the server" ;__________________________________________________________________________ ; All domain users get the following directories mapped - P: is the Company ; Public directoy and H: is the Users personal directory. ;__________________________________________________________________________ If InGroup("Domain Users") Use P: "$ServerName\public" Use H: @HOMESHR "\" @HOMEDIR EndIf
If InGroup("Domain_Admins") Use I: "\\chifs1001\tech-ops" Else Goto "Administration_Mappings" EndIf
;Administration_Mappings :Administration_Mappings If InGroup("Administrations") Use T: "$ServerName\public" Else Goto "Business_Mappings" EndIf
;Business :Business_Mappings If InGroup("Marketing") Use T: "$ServerName\Business" Else Goto "Executive_Mappings" EndIf
;Executives :Executive_Mappings If InGroup("Executives") Use T: "$ServerName\CEO" Else Goto "Facilities_Mappings" EndIf
;Facilities :Facilities_Mappings If InGroup("Facilities") Use T: \\chifs1001\Facilities Use S: \\chifs1001\Administration Else Goto "Finance_Mappings" EndIf
;Finance :Finance_Mappings If InGroup("Finance") Use T: \\chifs1001\Finance Use S: \\chifs1001\Finance_temp Else Goto "HR_Mappings" EndIf
;Human Resources :HR_Mappings If InGroup("HR") use T: \\chifs1001\HR use R: \\chifs1001\Facilities Use S: \\chifs1001\Administration Else Goto "Latin_America" EndIf
;Latin America :Latin_America If InGroup("latin America") use T: \\chifs1001\Latin America Else Goto "Legal_Mappings" EndIf
;Legal :Legal_Mappings If InGroup("Legal") use T: \\chifs1001\legal Else Goto "Marketing_Mappings" EndIf
;Marketing :Marketing_Mappings If InGroup("Marketing") use T: \\chifs1001\Marketing Else Goto "Sales_Mappings" EndIf
;Sales :Sales_mappings If InGroup("Sales") use s: \\chifs1001\business use t: \\chifs1001\sales Else Goto "TechOps_Mappings" EndIf
;Tech-Ops :TechOps_Mappings If InGroup("Domain_Admins") use G: \\chifs1001\gxs use I: \\chifs1001\Contractors use P: \\chifs1001\Public use T: \\chifs1001\tech-ops EndIf
$Caption = "Inventorying Computer" $Comment = "GS1US will now conduct an inventory on your machine"
;Inventory:
;_____________________________________________________________ ; The first portion of the script does five things ; 1) Writes basic computer information to a text file = NetBIOS ; name.txt (overwrites) ; 2) Writes logon time to a text file = username.txt (appends) ; 3) Writes logon time to a text file = NetBIOS name.txt (appends) ; 4) Writes all logon info to a .csv file (appends) ; 5) Writes computer info to a .csv one time only for inventory ; purposes
Use z: /Delete /persistent Use z: "\\chifs1001\inventory"
; 1) Basic computer info for reference
RedirectOutput ("z:\Inventory\@WKSTA.txt",1)
?"NetBIOS name = "@WKSTA ?"Last login by "@USERID ?"OS = "@PRODUCTTYPE" with "@CSD ?"Memory = "MemorySize(0)" MB" ?"Processor type is "@CPU ?"Processor speed is "@MHZ ?"IP address = "@IPADDRESS0 ?"MAC address = "@ADDRESS ?"This information was gathered on "@DATE" at "@TIME
; 2) Tracks all logons by user
RedirectOutput ("Z:\Logins\@USERID.txt",0)
?@USERID" logged into the "@DOMAIN" on "@WKSTA" at "@TIME" on "@DATE" "
; The second part of this script performs an inventory of installed software on a PC ; by examining the portion of the registry where uninstall information is kept. ; The information is then recorded to a text file = computer name that is overwritten ; with each successive logon.
:software
RedirectOutput ("Z:\Software\@HOSTNAME.txt", 1) ?"Software installed on @HOSTNAME as of @DATE" ? ; Scroll through each subkey
$Index = 0
:Loop1
$KeyName = EnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $Index) If @ERROR = 0 Goto DisplayCheck
Else Goto End
EndIf
isplayCheck
; Check for DisplayName string, record information if it exists
Sorry Mr. Moderator. It was a holiday weekend and being in the military ....I took full advatage of the free time.
I have gone ahead and changed the time as requested on the first reply. The time now works! Can someone please provide guidance to how to check for AV and if not installed install.
Ok now i have a minor problem. I am testing my script with a Dummy User Account but the KIX Script will not load. I used a login.bat to call my KIX Script. Here's what I have for my login. I'm currently testing on a Windows XP machine.
@echo off
SETLOCAL
VER | find "NT" > nul If NOT errorlevel 1 GoTo Win_NT
VER | find "2000" > nul If NOT errorlevel 1 GoTo Win_2000
VER | find "XP" > nul If NOT errorlevel 1 GoTo Win_XP
Registered: 2003-08-29
Posts: 27
Loc: Emeryville, CA
estradac, Why are you using a .bat file? Are you in an Active Directory domain? If so, setup a GPO to launch the login script. From what you posted, the only time that you dont launch the KIX script is with an Unknown OS, you could totally get rid of that. If you are unsure how to setup the GPO, you can either search the forum or shoot me an email and I can walk you through it. I used to try and run this using a .bat file, and it never worked correctly. Once i moved to the GPO, it works great.
Thanks for all the help. In reference to changing local admin password on laptop\desktops only, I know how i can do this via vbs but can someone show me how i can manipulate this simple vbs script into kix
All, I am trying to incorporate this TrendMicro UDF but it keeps failing not sure what i am doing wrong. Can someone shed some guidance.
Code:
?$Caption = "Checking Antivirus" ?$Comment = "Checking Antivirus on your system "
dim $rc, $SetupFilespec
$SetupFilespec='\\chiau1001\ofcscan\AutoPcc.exe' ; $SetupNotifyMsg='Trend Micro Office Scan anti-virus will be installed to your computer.' + @CRLF + 'While this process completes in the background, your system may respond a bit slower than normal. ' + @CRLF + @CRLF + 'Please do not logoff or reboot for at least 5 minutes to allow the process to complete normally.' + @CRLF + @CRLF + 'If you receive this message more than once, please notify HelpDesk at xxx xxx-xxxx.' ; $NoSetupFileMsg='Your computer is not allowed to connect to this network without the approved Anti-Virus software. '+ 'Please contact the HelpDesk at xxx xxx-xxxx for assistance.' ; if @InWin = 1 ; NT Family ; if not keyexist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OfficeScanNT') if exist($SetupFilespec) $rc=slExec('Admin Async Hidden',$SetupFilespec,) $rc=slAlert('X','PLEASE READ - IMPORTANT NOTICE',$SetupNotifyMsg,0,1) Else $rc=slAlert('X','',$NoSetupFileMsg,60,1) $rc=slLogoff(1) EndIf EndIf EndIf EndIf
Minor modifications by NTDOC
Don't see anything in the code to call the Trend UDF or an installer Are you using ScriptLogic with this code?
Code:
Break On Dim $SO $SO=SetOption('Explicit','On') $SO=SetOption('NoVarsInStrings','On') $SO=SetOption('NoMacrosInStrings','On')
Dim $Caption,$Comment,$rc, $SetupFilespec,$SetupNotifyMsg,$NoSetupFileMsg $Caption = "Checking Antivirus" ? $Comment = "Checking Antivirus on your system " ? $SetupFilespec='\\chiau1001\ofcscan\AutoPcc.exe' $SetupNotifyMsg='Trend Micro Office Scan anti-virus will be installed to your computer.' + @CRLF + 'While this process completes in the background, your system may respond a bit slower than normal. ' + @CRLF + @CRLF + 'Please do not logoff or reboot for at least 5 minutes to allow the process to complete normally.' + @CRLF + @CRLF + 'If you receive this message more than once, please notify HelpDesk at xxx xxx-xxxx.' $NoSetupFileMsg='Your computer is not allowed to connect to this network without the approved Anti-Virus software. ' + 'Please contact the HelpDesk at xxx xxx-xxxx for assistance.'
If @InWin = 1 ; NT Family If Not KeyExist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OfficeScanNT') If Exist($SetupFilespec) $rc=slExec('Admin Async Hidden',$SetupFilespec,) $rc=slAlert('X','PLEASE READ - IMPORTANT NOTICE',$SetupNotifyMsg,0,1) Else ;What is slAlert ? and slLogoff - don't see them anywhere here $rc=slAlert('X','',$NoSetupFileMsg,60,1) $rc=slLogoff(1) EndIf EndIf EndIf