#10785 - 2001-07-24 05:32 PM
Inventory Script for all OS's!
|
Anonymous
Anonymous
Unregistered
|
Hi there,Here follows the code for this nead Inventory Script. External programes needed are: - Memory.exe : download at MCA's - Cpu.exe : download at MCA's - Sort.exe : Pull it out of your OS The only problem is that every OS, even subversions (a,b,c), have their own sort file!!! Just ask me to E-mail them, or maybe someone can place them on the board... (previous posting) The script requires that all the sort.exe files are renamed to: Sort95a.exe / Sort95.exe / SortNT.exe / Sort2k.exe (check script). Here it is: (Maybe the code is f*cked up because of UBB, sorry!)
code:
;******************************************************************************* ;** Script: Blokker B.V. Inventory script ;** Version: 1.18c ;** Created: June 2, 2001 ;** ;** E-mail: slminc90@hotmail.com ;** ;** Works for NT & W9x ;** Rename Sort.exe from all OS: W95a/W95b/W98/NT4/W2k ;** - Sort95a.exe / Sort95b / Sort98 / SortNT.exe / SortW2k ;** ;** ;** Modifications: ;** - Jun/02/01 - Designed the global structure ;** - Jun/05/01 - Added Standard KIX Macro's ;** - Jun/07/01 - Added Installed software ;** - Jun/12/01 - Added Persistant drive mappings ;** - Jun/13/01 - Added Network and local printers ;** - Jun/13/01 - Added OS Information ;** - Jun/17/01 - Added McAfee information ;** - Jun/19/01 - Added Office detection ;** - Jun/20/01 - Added Run once every 7 days ;** - Jun/21/01 - Added Sort option of installed software ;** - Jun/24/01 - Added Copy files to central directory and create own stucture ;** - Jun/25/01 - Added CPU Information ;** - Jun/29/01 - Added Memory Information ;** ;** - xxx/xx/xx - Add new entries here! ;** ;******************************************************************************* ;******************************************************************************* BREAK OFF CLS ;IF @WKSTA=("Ams000020") ;GOTO MAIN ;ENDIF $HKLM = "HKEY_LOCAL_MACHINE\" $KixSubKey = $HKLM + "SOFTWARE\KiXtart" $ScriptKey = "\" + "DateCheck" If Existkey ("$KixSubKey$ScriptKey") <> 0 $key = Addkey ("$KixSubKey$ScriptKey") ; Add the key if not exist Goto KeyEntry ENDIF $LastRun = READVALUE("$KixSubKey$ScriptKey","LastRunDate") SELECT CASE @YDAYNO - $LastRun > 7 GOTO "KeyEntry" ; More than 7 days ago CASE 1 Color r+/n AT ( 4, 4) "N" Color w+/n AT ( 4, 5) "o" Color r+/n AT ( 4, 7) "N" Color w+/n AT ( 4, 8) "e" Color w+/n AT ( 4, 9) "e" Color r+/n AT ( 4,10) "d" Color r+/n AT ( 4,12) "T" Color w+/n AT ( 4,13) "o" Color r+/n AT ( 4,15) "R" Color w+/n AT ( 4,16) "u" Color r+/n AT ( 4,17) "n" Color r+/n AT ( 4,19) "A" Color w+/n AT ( 4,20) "n" Color r+/n AT ( 4,22) "I" Color w+/n AT ( 4,23) "n" Color r+/n AT ( 4,24) "v" Color w+/n AT ( 4,25) "e" Color r+/n AT ( 4,26) "n" Color w+/n AT ( 4,27) "t" Color r+/n AT ( 4,28) "o" Color w+/n AT ( 4,29) "r" Color r+/n AT ( 4,30) "y" Color w+/n AT ( 4,32) "!" Sleep 2 ; $return = DELKEY ("$KixSubKey$ScriptKey" ; Use this to reset clients GOTO "END" ENDSELECT ;****************************************************************************** ;** KeyEntry when was last run Inventory Script ;****************************************************************************** :KeyEntry $return = WRITEVALUE("$KixSubKey$ScriptKey","LastRunDate","@YDAYNO","REG_SZ") DEL ("C:\KIX32\@WKSTA\*.doc") ; Delete Inventory documents, leave only the newest on local machine ;****************************************************************************** ;** Main script starts here ;****************************************************************************** :MAIN ; ****************************************************************************** ; Cleanup old situation ; ****************************************************************************** IF EXIST ("C:\KIX32\kbd*.kbd") = 1 COPY ("C:\KIX32\kbd*.kbd") ("C:\KIX32\BACKUP\") DEL ("C:\KIX32\kbd*.kbd") ENDIF IF EXIST ("C:\KIX32\msnet32.old") = 1 COPY ("C:\KIX32\msnet32.old") ("C:\KIX32\BACKUP\") DEL ("C:\KIX32\msnet32.old") ENDIF IF EXIST ("C:\KIX32\autoexec.m32") = 1 COPY ("C:\KIX32\autoexec.m32") ("C:\KIX32\BACKUP\") DEL ("C:\KIX32\autoexec.m32") ENDIF IF EXIST ("C:\KIX32") = 0 MD ("C:\KIX32") ENDIF IF EXIST ("C:\KIX32\@WKSTA") = 0 MD ("C:\KIX32\@WKSTA") ENDIF IF EXIST ("C:\KIX32\BACKUP") = 0 MD ("C:\KIX32\BACKUP") ENDIF IF EXIST ("C:\KIX32\TEMP") = 0 MD ("C:\KIX32\TEMP") ENDIF IF EXIST ("C:\KIX32\TEMP") = 1 DEL ("C:\KIX32\Temp\*.*") ENDIF IF EXIST ("C:\KIX32\SORT") = 0 MD ("C:\KIX32\SORT") ENDIF IF EXIST ("C:\KIX32\sort*.*") = 1 DEL ("C:\KIX32\sort*.*") ENDIF IF EXIST ("C:\KIX32\EXTERNAL") = 0 MD ("C:\KIX32\EXTERNAL") ENDIF IF EXIST ("C:\KIX32\*.tag") = 0 DEL ("C:\KIX32\*.tag") ENDIF IF EXIST ("C:\KIX32\INVENTORY") = 0 MD ("C:\KIX32\Inventory") ENDIF IF EXIST ("C:\KIX32\Inv*.*") = 1 DEL ("C:\KIX32\Inv*.*") ENDIF ; ****************************************************************************** ; Create Variables ; ****************************************************************************** CLS Color Y+/N AT (5,17) "Please wait while we inventory your system...!" Color G+/N AT (6,15) "__________________________________________________"+CHR(13)+CHR(10)+CHR(13)+CHR(10)+CHR(13)+CHR(10) ; SETCONSOLE ("HIDE") $output=RedirectOutput("C:\Kix32\Temp\inventory.dat") Color N+/N $UserID="Undetermined User" ; User NT Account $UserNM="Undetermined Fullname" ; User FullName $UserDM="Undetermined Domain" ; User Domain $UserPG="Undetermined Primairy" ; User PrimaryGroup $SystNM="Undetermined System name" ; System Name $SystIP="Undetermined IP Adress" ; System IP Address $SystMC="Undetermined MAC Adress" ; System MAC Address $Unc ="No Network printer installed" ; Network printers $Lpt ="No Local printer installed" ; Local Printers ; Select OS modifications :OSMod SELECT CASE @InWin = 1 $CommandOption = "/X /C" $DirOption = "/T /b" $SortOption = "/R" CASE @InWin = 2 $CommandOption = "/C" $DirOption = "/O /D /b" $SortOption = "/R" ENDSELECT ;****************************************************************************** ;** Preset Info ;****************************************************************************** :PreInfo $FLServer="NTADAMPDC" ; Collects information on 1 server only $Date=SUBSTR(@DATE,1,4)+"_"+SUBSTR(@DATE,6,2)+"_"+SUBSTR(@DATE,9,2) $UserID=@USERID $UserNM=@FULLNAME $UserDM=@LDOMAIN $SystNM=@WKSTA $SystIP0=LTRIM(SUBSTR(@IPADDRESS0,1,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,5,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,9,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,13,3)) $SystIP1=LTRIM(SUBSTR(@IPADDRESS1,1,3))+"."+LTRIM(SUBSTR(@IPADDRESS1,5,3))+"."+LTRIM(SUBSTR(@IPADDRESS1,9,3))+"."+LTRIM(SUBSTR(@IPADDRESS1,13,3)) $UserPG=@PRIMARYGROUP $SystMC0=SUBSTR(@ADDRESS0,1,2)+":"+SUBSTR(@ADDRESS0,3,2)+":"+SUBSTR(@ADDRESS0,5,2)+":"+SUBSTR(@ADDRESS0,7,2)+":"+SUBSTR(@ADDRESS0,9,2)+":"+SUBSTR(@ADDRESS0,11,2) ;****************************************************************************** ;** Get OS Information ;****************************************************************************** :GetSYSInfo select Case @inwin=1 $kernel="WinNT" $type=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType") select Case @dos=5.0 $system="Windows 2000 " select Case $type<>"WinNT" $flavor="Server" Case $type="WinNT" $flavor="Professional" endselect Case @dos=4.0 $system="Windows NT4 " select Case $type="LANMANNT" $flavor="Domain Controller" Case $type="ServerNT" $flavor="Member Server" Case $type="WinNT" $flavor="Workstation" endselect endselect $Svcpack=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion") Case @inwin=2 $kernel="Windows 9x" $SubVer=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","SubVersionNumber") select Case @dos="4.90" $system="Windows ME" $flavor="A" Case @dos="4.10" $system="Windows 98" select Case $subver=" A " $flavor="Second Edition" Case $subver="a" OR $subver="a" $flavor="OEM" endselect Case @dos="4.0" $system="Windows 95" select Case $subver=" C" $flavor="OSR 2.5" Case $subver=" B" $flavor="OSR 2" Case $subver="" OR $subver="a" $flavor="OEM" endselect endselect $Svcpack = "Not Available" Case 1 $kernel = "Undetermined" $system = "Undetermined" $flavor = "Undetermined" $Svcpack = "Undetermined" endselect ;****************************************************************************** ;** Installed Software ;****************************************************************************** OPEN(1,"C:\Kix32\Temp\Tmp1.dat",5) $SIDN=0 $SID=ENUMKEY("HKEY_USERS\",$SIDN) WHILE @ERROR=0 $KEYN=0 $KEY=ENUMKEY("HKEY_USERS\$SID\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) WHILE @ERROR=0 $VALUE=READVALUE("HKEY_USERS\$SID\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","DisplayName") IF $VALUE="" $VALUE=READVALUE("HKEY_USERS\$SID\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","Title") ENDIF IF $VALUE<>"" $VALUE=$VALUE+CHR(13)+CHR(10) WRITELINE(1,$VALUE) ENDIF $KEYN=$KEYN+1 $KEY=ENUMKEY("HKEY_USERS\$SID\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) LOOP $SIDN=$SIDN+1 $SID=ENUMKEY("HKEY_USERS\",$SIDN) LOOP $KEYN=0 $KEY=ENUMKEY("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) WHILE @ERROR=0 $VALUE=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","DisplayName") IF $VALUE="" $VALUE=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","Title") ENDIF IF $VALUE<>"" $VALUE=$VALUE+CHR(13)+CHR(10) WRITELINE(1,$VALUE) ENDIF $KEYN=$KEYN+1 $KEY=ENUMKEY("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) LOOP $KEYN=0 $KEY=ENUMKEY("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) WHILE @ERROR=0 $VALUE=READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","DisplayName") IF $VALUE="" $VALUE=READVALUE("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$KEY","Title") ENDIF IF $VALUE<>"" $VALUE=$VALUE+CHR(13)+CHR(10) WRITELINE(1,$VALUE) ENDIF $KEYN=$KEYN+1 $KEY=ENUMKEY("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$KEYN) LOOP CLOSE(1) ;****************************************************************************** ;** Sort Installed Software ;****************************************************************************** IF (($system="Windows NT4 ") OR ($system="Windows 2000 ")) DEL ("C:\KIX32\INVENTORY\Inv*.*") COPY @SCRIPTDIR + "\UPDATES\INVENTORY\NT\InventNT*.*" "C:\KIX32\INVENTORY\" ELSE DEL ("C:\KIX32\INVENTORY\Inv*.*") COPY @SCRIPTDIR + "\UPDATES\INVENTORY\W9x\Inv*.*" "C:\KIX32\INVENTORY\" ENDIF select case $system = "Windows NT4 " IF EXIST ("C:\KIX32\SORT\sortNT.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\SortNT.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sortNT.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case $system = "Windows 2000 " IF EXIST ("C:\KIX32\SORT\sort2k.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\Sort2k.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sort2k.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case $system = "Windows 95" AND $flavor="OEM" ; Windows 95a IF EXIST ("C:\KIX32\SORT\sort95a.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\Sort95a.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sort95a.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case $system = "Windows 95" AND $flavor <> "OEM" ; Windows 95b/c IF EXIST ("C:\KIX32\SORT\sort95.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\Sort95.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sort95.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case $system = "Windows 98" IF EXIST ("C:\KIX32\SORT\sort98.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\Sort98.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sort98.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case $system = "Windows ME" IF EXIST ("C:\KIX32\SORT\sortME.*")=0 COPY @SCRIPTDIR + "\Updates\SORT\SortME.exe" "C:\KIX32\SORT\" ENDIF SHELL "%Comspec% $CommandOption C:\KIX32\SORT\sortME.exe < C:\KIX32\Temp\Tmp1.dat > C:\KIX32\Temp\Tmp2.dat" case 1 COPY "C:\KIX32\Temp\Tmp1.dat" "C:\KIX32\Temp\Tmp2.dat" endselect ;****************************************************************************** ;** Printer info ;****************************************************************************** :Printer $INDEX=0 $Loop = "Y" While $Loop = "Y" $ValueKey = ENUMKEY("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers", $Index) If @ERROR = 0 If $Index = 0 $Unc=$ValueKey + ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\", "Port") Else ; $Lpt=ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\" + $ValueKey, "Port") $Lpt=$ValueKey + ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\", "Port") Endif $Index = $Index + 1 Else $Loop = "N" Endif LOOP ;****************************************************************************** ;** CPU info ;****************************************************************************** IF EXIST ("C:\Kix32\External\cpu.exe") = 0 COPY @SCRIPTDIR + "\Updates\External\cpu.exe" "C:\Kix32\External\" ENDIF $Tmp_directory=("C:\Kix32\Temp") $Cpu_file=$tmp_directory+"\cpu.dat" $Cpu_program="C:\Kix32\External\Cpu.exe" $Cpu="??? MHz" $Processor="???" Shell "%Comspec% /c "+$Cpu_program+" >"+$Cpu_file IF (Open(9,$Cpu_file) = 0) $Result=ReadLine(9) ; - skip - $Result=ReadLine(9) IF (Len($Result) > 3) $cpu=LTRIM(RTRIM(Substr($result,Instr($result,",")+1,Len($result)-Instr($result,",")))) $Processor=LTRIM(RTRIM(Substr($result,Instr($result,":")+2,Len($result)-Instr($result,":")-2+1))) ENDIF IF (Close(9) <> 0) ENDIF ENDIF ;****************************************************************************** ;** Memory Info for W9x / NT4 / W2k ;** External programs: memory.exe, winmsd.exe (nt), mem.exe (95) ;****************************************************************************** $debug_mode="no" ; yes = temporary files will not be deleted $memory_file="memory.exe" $local_drive="c:\kix32"
MD $local_drive+"\temp" IF (@error = 0) ENDIF IF EXIST ("C:\KIX32\External\memory.exe") = 0 COPY @SCRIPTDIR + "\Updates\External\memory.exe" "C:\Kix32\External\" ENDIF IF (@inwin = 1) $NT_mode="yes" IF (Exist("c:\kix32\external\"+$memory_file) = 1) $memory_file="c:\kix32\external\"+$memory_file ENDIF ELSE $NT_mode="no" IF (Exist("c:\kix32\external\"+$memory_file) = 1) $memory_file="c:\kix32\external\"+$memory_file ENDIF ENDIF $os_type="" SELECT CASE ($NT_mode = "yes") AND (@dos = "5.0") ; - Windows 2000 - $os_type="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os_type="NT4" CASE ($NT_mode <> "yes") AND (@dos = "4.90") ; - Windows ME - $os_type="ME" CASE ($NT_mode <> "yes") AND (@dos = "4.10") ; - Windows 98 - $os_type="W98" CASE ($NT_mode <> "yes") AND (@dos = "4.0") ; - Windows 95 - $os_type="W95" CASE 1 $os_type="???" ; - undetermined - ENDSELECT
; - :script_memory $memory=0 IF (exist($memory_file) = 1) ;Physical memory is 133599232 bytes - memory.exe - ; ;133599232 - memory.exe /s - IF (exist($local_drive+"\temp\memory.txt") = 1) del $local_drive+"\temp\memory.txt" ENDIF shell "%comspec% /c "+$memory_file+" /s >"+$local_drive+"\temp\memory.txt" IF (open(9,$local_drive+"\temp\memory.txt") = 0) $result=ReadLine(9) IF (len($result) > 3) $memory=Val(LTRIM(RTRIM($result)))/1024 IF (len("$memory") <= 8) $memory=substr(" ",1,9-len("$memory"))+$memory ENDIF ENDIF IF (CLOSE(9) <> 0) ENDIF ENDIF IF (exist($local_drive+"\temp\memory.txt") = 1) IF ($debug_mode <> "yes") del $local_drive+"\temp\memory.txt" ENDIF ENDIF ? "Memory (memory.exe): "+LTRIM(RTRIM($memory))+" KBytes" ENDIF ; IF ($memory = 0) IF ($NT_mode = "yes") AND ($os_type <> "W2K") ; - "W2K_Professional" + "W2K_Server" - ; ;Physical Memory (K) ; Total: 64,948 ; Available: 31,840 ; File Cache: 14,652 ; IF (exist($local_drive+"\temp\"+@wksta+".txt") = 1) del $local_drive+"\temp\"+@wksta+".txt" ENDIF IF (exist($local_drive+"\temp\memory.txt") = 1) del $local_drive+"\temp\memory.txt" ENDIF cd $local_drive+"\temp" shell "%comspec% /c winmsd /s /f" ; - /s = summary; /f = to file - shell '%comspec% /c echo Total: 0 >'+$local_drive+'\temp\memory.txt' shell '%comspec% /c echo. >>'+$local_drive+'\temp\memory.txt' shell '%comspec% /c type '+@wksta+'.txt | find " Total:" >>'+$local_drive+'\temp\memory.txt' IF (open(9,$local_drive+"\temp\memory.txt") = 0) $result=ReadLine(9) WHILE (@error = 0) $pos=INSTR(LCASE($result), "total:") IF ($pos <> 0) $memory=substr($result,$pos+6,len($result)-$pos-1) ENDIF $result=ReadLine(9) LOOP IF (CLOSE(9) <> 0) ENDIF ENDIF ENDIF IF ($NT_mode <> "yes") ; ;Memory Type Total Used Free ;---------------- -------- -------- -------- ;Conventional 640K 86K 554K ;Upper 0K 0K 0K ;Reserved 0K 0K 0K ;Extended (XMS) 65.472K ? 129.764K ;---------------- -------- -------- -------- ;Total memory 66.112K ? 130.318K ; IF (exist($local_drive+"\temp\mem.txt") = 1) del $local_drive+"\temp\mem.txt" ENDIF IF (exist($local_drive+"\temp\memory.txt") = 1) del $local_drive+"\temp\memory.txt" ENDIF shell "%comspec% /c mem >"+$local_drive+"\temp\mem.txt" shell '%comspec% /c echo Total memory 0K ? 0K >'+$local_drive+'\temp\memory.txt' shell '%comspec% /c echo. >>'+$local_drive+'\temp\memory.txt' shell '%comspec% /c type '+$local_drive+'\temp\mem.txt | find "Total memory" >>'+$local_drive+'\temp\memory.txt' shell '%comspec% /c type '+$local_drive+'\temp\mem.txt | find "Totaal geheugen" >>'+$local_drive+'\temp\memory.txt' ; IF (open(9,$local_drive+"\temp\memory.txt") = 0) $result=ReadLine(9) WHILE (@error = 0) $result=RTRIM($result) $pos=INSTR(LCASE($result), "total memory") IF ($pos <> 0) AND ($memory = 0) $memory=LTRIM(RTRIM(substr($result,39,len($result)-39))) ENDIF $pos=INSTR(LCASE($result), "totaal geheugen") IF ($pos <> 0) AND ($memory = 0) $memory=LTRIM(RTRIM(substr($result,39,len($result)-39))) ENDIF $result=ReadLine(9) LOOP IF (CLOSE(9) <> 0) ENDIF ENDIF ENDIF IF (exist($local_drive+"\temp\"+@wksta+".txt") = 1) del $local_drive+"\temp\"+@wksta+".txt" ENDIF IF (exist($local_drive+"\temp\mem.txt") = 1) IF ($debug_mode <> "yes") del $local_drive+"\temp\mem.txt" ENDIF ENDIF IF (exist($local_drive+"\temp\memory.txt") = 1) IF ($debug_mode <> "yes") del $local_drive+"\temp\memory.txt" ENDIF ENDIF IF ($os_type <> "W2K") ; - "W2K_Professional" + "W2K_Server" - $memory=LTRIM(RTRIM("$memory")) IF (len("$memory") <= 8) $memory=substr(" ",1,9-len("$memory"))+$memory ENDIF ; IF ($NT_mode = "yes") ? "Memory.NT[winmsd]: "+LTRIM(RTRIM($memory))+" KBytes" ELSE ? "Memory.95[mem]: "+LTRIM(RTRIM($memory))+" KBytes" ENDIF ELSE ? "Memory.W2K[winmsd]: ? KBytes" ENDIF ENDIF ;****************************************************************************** ;** Process Info ;****************************************************************************** :ProInfo IF EXIST ("C:\KIX32\@WKSTA\@WKSTA_$Date.DOC")=1 DEL ("C:\KIX32\@WKSTA\@WKSTA_$Date.DOC") ENDIF OPEN(1,"C:\KIX32\@WKSTA\@WKSTA_$Date.DOC",5) ;------------------------------------------------------------------------------ IF $system="Windows NT4 " OR $system="Windows 2000 " ; Reading the computers network comment $SystCM="Not Available on NT4 and W2k machines!" Else $SystCM=ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP\", "Comment") Endif ;------------------------------------------------------------------------------ $FILL="| |" WRITELINE(1,"+-----------------------[ System & User Informationsheet ]---------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"| User NT Account : $UserID"+SUBSTR($FILL,25+LEN($UserID),55-LEN($UserID))+CHR(13)+CHR(10)) WRITELINE(1,"| User FullName : $UserNM"+SUBSTR($FILL,25+LEN($UserNM),55-LEN($UserNM))+CHR(13)+CHR(10)) WRITELINE(1,"| User Domain : $UserDM"+SUBSTR($FILL,25+LEN($UserDM),55-LEN($UserDM))+CHR(13)+CHR(10)) WRITELINE(1,"| User PrimaryGroup : $UserPG"+SUBSTR($FILL,25+LEN($UserPG),55-LEN($UserPG))+CHR(13)+CHR(10)) WRITELINE(1,"| System Name : $SystNM"+SUBSTR($FILL,25+LEN($SystNM),62-LEN($SystNM))+CHR(13)+CHR(10)) WRITELINE(1,"| System Comment : $SystCM"+SUBSTR($FILL,25+LEN($SystCM),62-LEN($SystCM))+CHR(13)+CHR(10)) WRITELINE(1,"| System IP# 0 : $SystIP0"+SUBSTR($FILL,25+LEN($SystIP0),62-LEN($SystIP0))+CHR(13)+CHR(10)) WRITELINE(1,"| System IP# 1 : $SystIP1"+SUBSTR($FILL,25+LEN($SystIP1),62-LEN($SystIP1))+CHR(13)+CHR(10)) WRITELINE(1,"| System MAC : $SystMC0"+SUBSTR($FILL,25+LEN($SystMC0),62-LEN($SystMC0))+CHR(13)+CHR(10)) WRITELINE(1,"| System OS : $System"+" / $flavor"+SUBSTR($FILL,25+LEN($System),62-LEN($System))+CHR(13)+CHR(10)) WRITELINE(1,"| Service Pack (NT) : $Svcpack"+SUBSTR($FILL,25+LEN($Svcpack),62-LEN($Svcpack))+CHR(13)+CHR(10)) WRITELINE(1,"| Processor Type/Speed : $processor"+SUBSTR($FILL,25+LEN($processor),62-LEN($processor))+CHR(13)+CHR(10)) WRITELINE(1,"| Available Memory : " +LTRIM(RTRIM($memory)) +" KBytes"+SUBSTR($FILL,25+LEN($memory),62-LEN($memory))+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"+--------------------------[ Persistent System Mounts ]------------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) ;****************************************************************************** ;** Persistant Connections ;****************************************************************************** SHELL '%Comspec% $CommandOption NET USE | FIND "\\" > C:\KIX32\Temp\Netuse.dat' OPEN(3,"C:\KIX32\Temp\Netuse.dat",2) $map=READLINE(3) IF $map WHILE @ERROR=0 WRITELINE(1,"| $map"+SUBSTR($FILL,25+LEN($map),78-LEN($map))+CHR(13)+CHR(10)) $map=READLINE(3) LOOP ENDIF WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"+--------------------------[ Persistent Printer Mounts ]-----------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"| $Unc"+SUBSTR($FILL,25+LEN($Unc),78-LEN($Unc))+CHR(13)+CHR(10)) WRITELINE(1,"| $Lpt"+SUBSTR($FILL,25+LEN($Lpt),78-LEN($Lpt))+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) CLOSE(3) ;****************************************************************************** ;** McAfee Inventory ;****************************************************************************** $regPath = "HKEY_LOCAL_MACHINE\SOFTWARE" SELECT CASE $VS403Code = ExistKey($regPath + "Network Associates\McAfee VirusScan") CASE $NS403aCode = ExistKey($regPath + "Network Associates\NetShield NT") ; Server version CASE $NS403aCode = ExistKey($regPath + "Network Associates\VirusScan NT") ; Workstation version CASE $VS45Code = ExistKey($regPath + "Network Associates\TVD\VirusScan") CASE $VS45Code = ExistKey($regPath + "Network Associates\TVD\NetShield NT") CASE 1 ENDSELECT SELECT CASE $VS403Code=0 $McAfeeVersion = "McAfee VirusShield : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szProductVer"),1,53) $EngineVersion = "McAfee EngineVersion : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szEngineVer"),1,53) $DatfileVersion = "McAfee DAT Version : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szVirDefVer"),1,53)+ " / Date: "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szVirDefDate"),1,53) CASE $NS403aCode=0 $McAfeeVersion = "McAfee NetShield : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szProductVer"),1,53) $EngineVersion = "McAfee EngineVersion : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szEngineVer"),1,53) $DatfileVersion = "McAfee DAT Version : "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szVirDefVer"),1,53)+ " / Date: "+SUBSTR(READVALUE("$regPath\McAfee\VirusScan","szVirDefDate"),1,53) CASE $VS45Code=0 $McAfeeVersion = "McAfee VirusShield : "+SUBSTR(READVALUE("$regPath\Network Associates\TVD\NetShield NT\CurrentVersion","szProductVer"),1,53) $EngineVersion = "McAfee Engine Version : "+SUBSTR(READVALUE("$regPath\Network Associates\TVD\NetShield NT\CurrentVersion","szEngineVer"),1,53) $DatfileVersion = "McAfee DAT Version : "+SUBSTR(READVALUE("$regPath\Network Associates\TVD\NetShield NT\CurrentVersion","szVirDefVer"),1,53)+ " / Date: "+SUBSTR(READVALUE("$regPath\Network Associates\TVD\NetShield NT\CurrentVersion","szVirDefDate"),1,53) CASE 1 $McAfeeVersion = "McAfee Program Version : Undetermined" $EngineVersion = "McAfee Engine Version : Undetermined" $DatfileVersion = "McAfee Datfile Version : Undetermined" ENDSELECT WRITELINE(1,"+----------------------------[ McAfee Virusscan ]------------------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"| $McAfeeVersion" +SUBSTR($fill,2+LEN($McAfeeVersion), LEN($fill)-LEN($McAfeeVersion)) +CHR(13)+CHR(10)) WRITELINE(1,"| $EngineVersion" +SUBSTR($fill,2+LEN($EngineVersion), LEN($fill)-LEN($EngineVersion)) +CHR(13)+CHR(10)) WRITELINE(1,"| $DatfileVersion" +SUBSTR($fill,2+LEN($DatfileVersion), LEN($fill)-LEN($DatfileVersion)) +CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) WRITELINE(1,"+-------------------------[ Installed Applications ]---------------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| |"+CHR(13)+CHR(10)) ;****************************************************************************** ;** Apps Inventory ;****************************************************************************** $LC=2 OPEN(2,"C:\KIX32\Temp\Tmp2.dat") $Apps=READLINE(2) WHILE @ERROR=0 IF $Apps<>$PrevApps WRITELINE(1,"| $Apps"+SUBSTR($FILL,2+LEN($Apps),78-LEN($Apps))+CHR(13)+CHR(10)) $LC=$LC+1 ; IF $LC=45 ; $Apps="Other." ; WRITELINE(1,"| $Apps"+SUBSTR($FILL,2+LEN($Apps),78-LEN($Apps))+CHR(13)+CHR(10)) ; CLOSE(2) ; ENDIF ENDIF $PrevApps=$Apps $Apps= READLINE(2) LOOP CLOSE(2) DO WRITELINE(1,"| |"+CHR(13)+CHR(10)) $LC=$LC+1 ; UNTIL $LC=50 $PM="Info for System "+$SystNM+" and User "+$UserNM+" on "+@DATE+" at "+@TIME WRITELINE(1,"+------------------------------------------------------------------------------+"+CHR(13)+CHR(10)) WRITELINE(1,"| $PM"+SUBSTR($FILL,2+LEN($PM),78-LEN($PM))+CHR(13)+CHR(10)+CHR(13)+CHR(10)) CLOSE(1) ;****************************************************************************** ;** Office Version Inventory ;****************************************************************************** :Office If 1 = 1 DIM $file, $HKLMAppPaths, $app, $path, $version, $nul, $index $HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" $file = "C:\KIX32\@WKSTA\@WKSTA_$Date.DOC" while @error = 0 $app = enumkey("$HKLMAppPaths\",$index) $index = $index + 1 select case $app = "excel.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Suite" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $esr") case $app = "winword.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Suite" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $esr") case $app = "powerpnt.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Suite" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $esr") case $app = "msaccess.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Access" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $asr") case $app = "mspub.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Publisher" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $psr") case $app = "winproj.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") Gosub "Project" $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version / $prsr") case $app = "visio32.exe" $path = readvalue("$HKLMAppPaths\$app","") $version = getfileversion("$path","Productversion") $nul = writeprofilestring($file,"Installed Office Suite:","$app","$version") endselect loop endif GOTO "InvDir" ;****************************************************************************** ;** Office Suite Determination ;****************************************************************************** :Suite select case $version=7.0 $esr="MS Office95" case $version=7.0a $esr="MS Office95 Pro" case $version=8.0 $esr="MS Office97 SR-0" case $version=8.0a $esr="MS Office97 SR-1" case $version=8.0b $esr="MS Office97 SR-2" case $version=8.0e $esr="MS Office97 SR-2" case $version=9.0.2719 $esr="MS Office2000" case $version=9.0.3822 $esr="MS Office2000 SR-1a" case 1 $esr="Undetermined" endselect Return :Access select case $version=8.0.3512 $asr="MS Access97 SR-0" case $version=8.0.4122 $asr="MS Access97 SR-1" case $version=8.0.5903 $asr="MS Access97 SR-2" case $version=9 $asr="MS Access2000" case $version=9.0.3822 $asr="MS Access2000 SR-1a" case 1 $asr="Undetermined" endselect Return :Publisher select case $version=4.0 $psr="MS Publisher 97" case $version=5.0 $psr="MS Publisher 98" case $version=6.0 $psr="MS Publisher 2000" case 1 $psr="Undetermined" endselect Return :Project select case $version=8.0 $prsr="MS Project 98" case $version=9.0 $prsr="MS Project 2000" case 1 $prsr="Undetermined" endselect Return ;****************************************************************************** ;** Copy the Inventory to the right Directory, and create the appr. directory ;****************************************************************************** :InvDir $Filecopy="\\$FLServer\Workstations" select case @LDOMAIN="NTADAM.DOM" $Geo="Amsterdam" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy case @LDOMAIN="NTBODE.DOM" $Geo="Bodegraven" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy case @LDOMAIN="NTGELDER.DOM" $Geo="Geldermalsen" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy case @LDOMAIN="NTLAREN.DOM" $Geo="Laren" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy case @LDOMAIN="NTLIER.DOM" $Geo="Lier" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy case @LDOMAIN="NTMYD.DOM" $Geo="Mydrecht" $Location="$Filecopy\$Geo" Gosub Dircheck Goto FCopy endselect ;****************************************************************************** ircheck If Exist ("$Location")=0 MD ("$Location") Endif Return ;****************************************************************************** :FCopy If Exist ("C:\KIX32\@WKSTA\Copy_Inv.bat")=1 ; Cleanup Old Stiuation Del ("C:\KIX32\@WKSTA\Copy_Inv.bat") Endif If Exist ("C:\KIX32\INVENTORY\Copy_Inv.bat")=1 ; Refresh the command file Del ("C:\KIX32\INVENTORY\Copy_Inv.bat") Endif ;****************************************************************************** ;** Create the command file to copy Client's Inventory to Server ;****************************************************************************** $CMsg0 = "@@ECHO OFF" + chr(13) + chr(10) $CMsg1 = "NET USE Z: /DELETE" + chr(13) + chr(10) $CMsg2 = "NET USE Z: $Filecopy" + chr(13) + chr(10) $CMsg3= "XCOPY /Q /I C:\KIX32\@WKSTA\*.DOC Z:\$Geo\@WKSTA" + chr(13) + chr(10) + chr(13) + chr(10) $CMsg4= "REM: Run this file copy inventory from system to central directory" + chr(13) + chr(10) $Temp = Open(1, "C:\KIX32\INVENTORY\Copy_Inv.bat", 5) $Temp = WriteLine(1, $CMsg0) $Temp = WriteLine(1, $CMsg1) $Temp = WriteLine(1, $CMsg2) $Temp = WriteLine(1, $CMsg3) $Temp = WriteLine(1, $CMsg4) $Temp = Close(1) SHELL "%Comspec% $CommandOption C:\KIX32\INVENTORY\Copy_Inv.bat" :END IF EXIST ("Z:\AMSTERDAM") = 1 USE Z: /DEL /PERSISTENT ENDIF EXIT
The only problem is that the script normaly starts up from the "Runonce" Key, and that you are missing 2 .BAT files to copy the inventory document(placed in C:\KIX32\@WKSTA), to a shared drive. You'll have to figure this out for yourself... Grtxx, Kira 
|
|
Top
|
|
|
|
#10786 - 2001-07-24 05:35 PM
Re: Inventory Script for all OS's!
|
Anonymous
Anonymous
Unregistered
|
Whoe ha ha!It looks even better on the board than it does in my network... Grtxx, Kira 
|
|
Top
|
|
|
|
#10787 - 2001-07-24 09:20 PM
Re: Inventory Script for all OS's!
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Here is my script... As the script runs, it collects all the client data into variables and at the end of the script dumps it into a CSV file to be opened by excel later...code:
? color c+/n "KiXtart "color w/n"is version " color w+/n @kix color w/n ? color y+/n "Determining Area Office and User..." color w/n gosub AreaOffice ? color y+/n "Setting Common Variable Values..." color w/n gosub Variables ? color y+/n "Determining Computer Hardware..." color w/n gosub Hardware ? color y+/n "Determining OS on Computer..." color w/n gosub OperatingSystem ? color y+/n "Determining Local Admin Privilege..." color w/n gosub LocalAdmin ? color y+/n "Setting Network Policies based on Groups..." color w/n gosub GroupPolicy ? color y+/n "Mapping Drives based on Groups..." color w/n gosub GroupDrives ? color y+/n "Installing Applications based on Groups..." color w/n gosub GroupApps ? color y+/n "Updating Applications..." color w/n gosub UpdateApps ? color y+/n "Performing Hardware and Software Inventory..." color w/n gosub Inventory ? color y+/n "Mapping Area Office Drives..." color w/n Call "$logon\AreaDrives.kix" ? color y+/n "Running Custom Area Office scripts..." color w/n Call "$logon\AreaScript.kix" ? color g+/n "Logon Script is Complete." color w/n ?EXIT ;*********************************** END OF LOGON SCRIPT, Returning to Logon.bat ********************************* ;***************************************************************************************************************** ;***************************************************************************************************************** ;****************************************** START OF SUBROUTINES ************************************************* ;***************************************************************************************************************** ;***************************************************************************************************************** ;***************************************** start of Area Office ************************************************** :AreaOffice select case ingroup("fdhc\area01") $area="01" $dcsa="zdnhz" case ingroup("fdhc\area02") $area="02" $dcsa="zgfnhZDs" case ingroup("fdhc\area03") $area="03" $dcsa="tjaaetj" case ingroup("fdhc\area04") $area="04" $dcsa="aetjzd" case ingroup("fdhc\area05") $area="05" $dcsa="zdthza" case ingroup("fdhc\area06") $area="06" $dcsa="zsdetjhade" case ingroup("fdhc\area07") $area="07" $dcsa="etjhdet" case ingroup("fdhc\area08") $area="08" $dcsa="edthjde" case ingroup("fdhc\area09") $area="09" $dcsa="zsdhzdg" case ingroup("fdhc\area10") $area="10" $dcsa="zdgjng" case ingroup("fdhc\area11") $area="11" $dcsa="dgtnhjzsdet" case @userid<>"administrator" $mess="Ask your DCSA to add you to your Area global group. Your logonscript will not run" messagebox("$mess","Message from MIS", 1) $text="@userid does not belong to an area group and logonscript for this person will not operate" sendmessage("gnhdgt","$text @ipaddress0") sendmessage("tjedtjh","$text @ipaddress0") quit endselect $group ="area$area" select case ingroup($group+"med") $dept="Medicaid" case ingroup($group+"mis") $dept="MIS" case ingroup($group+"mqa") $dept="MQA" case ingroup($group+"hqa") $dept="HQA" case ingroup($group+"legal") $dept="Legal" case ingroup($group+"OIG") $dept="OIG" case ingroup($group+"pi") $dept="OIG" case ingroup($group+"P&&C") $dept="P&C" case ingroup($group+"plans") $dept="P&C" case 1 $dept="" ; sendmessage("$dcsa","Cannot determine @userid group membership in $group") endselect $namesep=instr("@fullname",";") if $namesep=0 sendmessage("$DCSA","@userid @fullname is not formatted correctly") endif $positionnum=substr("@fullname",1,$namesep-1) $longname=Ltrim(substr("@fullname",$namesep+1,len("@fullname")-$namesep)) ? " Current user "color c+/n"$longname "color w/n "is a member of "color w+/n"Area" $area $dept color w/n Return ;******************************************* end of AreaOffice **************************************************** ;****************************************************************************************************************** ;******************************************* start of Variables *************************************************** :Variables $server="\\a$area" $logon ="$server\logon" $setup ="\\ada$area\setup$$" $HKLMS ="HKEY_LOCAL_MACHINE\Software" $HKCUS ="HKEY_CURRENT_USER\Software" $HKCPCPD ="HKEY_CURRENT_USER\Control Panel\Desktop" $HKLMHDS ="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System" $HKLMSCCS ="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet" $HKCUSMWCV ="$HKCUS\Microsoft\Windows\CurrentVersion" $HKLMSMWCV ="$HKLMS\Microsoft\Windows\CurrentVersion" $HKLMSMWNTCV ="$HKLMS\Microsoft\Windows NT\CurrentVersion" $HKCUSMWNTCV ="$HKCUS\Microsoft\Windows NT\CurrentVersion" $McAfeeRegKey="$HKLMS\McAfee\VirusScan" $McAfeeEngKey="$McAfeeRegKey\Tasks\Upgrade" $HKLMSMVSDT ="$McAfeeRegKey\VirusScan\McShield\CurrentVersion" $McAfeeAltKey="$HKLMS\McAfee\AlertManager\Recipients" $prd =readvalue("$McAfeeRegKey", "szProductVer") $eng =readvalue("$McAfeeRegKey", "szEngineVer") $dat =readvalue("$McAfeeRegKey", "szVirDefVer") $Mcdate =readvalue("$McAfeeRegKey", "szVirDefDate") $mceng =readvalue("$McAfeeEngKey", "szUpgradeCMD") $mcexe =readvalue("$McAfeeRegKey", "szUpdateEXE") $datdir =readvalue("$McAfeeRegKey", "DAT") $scanner =readvalue("$McAfeeRegKey", "scan32exe") $exts =readvalue("$HKLMSMVSDT" , "szProgExts") $desktop =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Desktop") $startmenu =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Start Menu") $favorites =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Favorites") $alldesktop =readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Desktop") $allstartmenu=readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Start Menu") $SubVer =ReadValue("$HKLMSMWCV","SubVersionNumber") $SvcPack =ReadValue("$HKLMSMWNTCV", "CSDVersion") $ProdType =ReadValue("$HKLMSCCS\Control\ProductOptions","ProductType") $MisMsg ="You computer needs a software update that will take about" $MisMsg1="Do you wish to install it at this time?" $MisMsg2="The update will now begin. Do not touch anything until the computer restarts on its own" $MisMsg3="The update will now begin. Do not touch anything until the update finishes" $spcurrent="Service Pack 6" $O8current="8.0.5.0.0" $iecurrent="5.00.2314.1003" $arcurrent="4.05" $McEngine ="4.1.40" $QPcurrent="3.2.0.10" $esr="" $asr="" $psr="" $impver="" $oraver="" $Winzipver="" $Biosv="" $Biosd="" $Make="" $Model="" $SerNo="" $Case="" $CPUfm="" $CPUsp="" $dimm1="" $dimm2="" $dimm3="" $memory="" $c=chr(44) $modem="" $owner="" $admin=0 $asefiletime="" $does="does not" return ;******************************************* end of Variables ***************************************************** ;****************************************************************************************************************** ;******************************************* start of OperatingSystem ********************************************* :OperatingSystem select Case @inwin=1 and $ProdType="WinNT" and @dos="5.0" $os="Win2k" $ostype="WinNT" $ossubver="$svcpack" Case @inwin=1 and $ProdType="WinNT" $os="WinNT" $ostype="WinNT" $ossubver="$svcpack" Case @inwin=2 and @dos="4.90" $os="WinME" $ostype="Win95" $ossubver="$subver" Case @inwin=2 and @dos="4.10" $os="Win98" $ostype="Win95" $ossubver="$subver" Case @inwin=2 and @dos="4.0" $os="Win95" $ostype="Win95" $ossubver="$subver" Case 1 $os="undetermined" $ostype="undetermined" $ossubver="undetermined" endselect ? " Installed "color c+/n "Operating System " color w/n "is " color w+/n $os color w/n ? " Installed "color c+/n "Service Pack " color w/n"is version "color w+/n $ossubver color w/n return ;******************************************* end of OperatingSystem ****************************************************** ;************************************************************************************************************************* ;******************************************** start of Hardware ********************************************************* :Hardware if @ras=0 and exist("c:\smbios.exe")=0 copy "$logon\smbios.exe" "c:\" endif go c: cd "c:\" del "c:\hardware.lst" shell "%comspec% /c c:\smbios.exe >nul" sleep 1 $Biosv=readprofilestring("c:\hardware.lst","Bios","Version") $biosd=readprofilestring("c:\hardware.lst","Bios","Date") $Make =readprofilestring("c:\hardware.lst","System","Make") $Model=readprofilestring("c:\hardware.lst","System","Model") $SerNo=readprofilestring("c:\hardware.lst","System","Serial#") $Case =readprofilestring("c:\hardware.lst","Case","Type") $CPUfm=readprofilestring("c:\hardware.lst","Processor-4","Family") $CPUsp=readprofilestring("c:\hardware.lst","Processor-4","CurSpeed") if $CPUfm="" $CPUfm=readprofilestring("c:\hardware.lst","Processor-400","Family") $CPUsp=readprofilestring("c:\hardware.lst","Processor-400","CurSpeed") endif select case $model="Inspiron 7500" $SerNo=readprofilestring("c:\hardware.lst","Case","Serial#") $SerNo=substr("$SerNo",1,5) $dimm1=readprofilestring("c:\hardware.lst","MemDev26","Size") $dimm2=readprofilestring("c:\hardware.lst","MemDev27","Size") $memory=val("$dimm1")+val("$dimm2") case $make="Dell Computer Corporation" $dimm1=readprofilestring("c:\hardware.lst","MemDev4352","Size") $dimm2=readprofilestring("c:\hardware.lst","MemDev4353","Size") $memory=val("$dimm1")+val("$dimm2") case $make="Compaq" and $Biosv="686J1 v1.10" $CPUfm=readprofilestring("c:\hardware.lst","Processor-5","Family") $CPUsp=readprofilestring("c:\hardware.lst","Processor-5","CurSpeed") $dimm1=readprofilestring("c:\hardware.lst","MemDev30","Size") $dimm2=readprofilestring("c:\hardware.lst","MemDev31","Size") $memory=val("$dimm1")+val("$dimm2") case $make="Compaq" $dimm1=readprofilestring("c:\hardware.lst","MemDev35","Size") $dimm2=readprofilestring("c:\hardware.lst","MemDev36","Size") $dimm3=readprofilestring("c:\hardware.lst","MemDev37","Size") $memory=val("$dimm1")+val("$dimm2")+val("$dimm3") endselect $freespace=getdiskspace("C:\") ? " Computer "color c+/n "Manufacturer " color w/n "is " color w+/n $Make color w/n ? " Computer "color c+/n "Model " color w/n "is " color w+/n $Model color w/n ? " Computer "color c+/n "Bios " color w/n "is " color w+/n $Biosv color w/n " dated " color w+/n $Biosd color w/n ? " Computer "color c+/n "Serial Number " color w/n "is " color w+/n $SerNo color w/n ? " Computer "color c+/n "Processor " color w/n "is a " color w+/n $CPUfm color w/n " running at " color w+/n $CPUsp color w/n ? " Computer "color c+/n "Memory " color w/n "is " color w+/n $memory " MB" color w/n return ;********************************************* end of Hardware *********************************************************** ;************************************************************************************************************************* ;******************************************* start of LocalAdmin ********************************************************* :LocalAdmin if $ostype="WinNT"and ingroup("\\@wksta\Administrators")>0 $owner=@userid $admin=1 $does="does" endif ? " @userid " color c+/n $does color w/n " have Local Admin privileges on " color w+/n"@wksta" color w/n return ;******************************************* end of LocalAdmin *********************************************************** ;************************************************************************************************************************* ;******************************************* start of GroupPolicy ******************************************************** :GroupPolicy if $os="Win2k" and $admin=1 ;? " Disable browsemaster for win2k machines" $MSL=ReadValue("$HKLMSCCS\Services\Browser\Parameters","MaintainServerList") if $MSL="auto" $=WriteValue("$HKLMSCCS\Services\Browser\Parameters","MaintainServerList","no",REG_SZ) endif ;? " Synchronizing "color c+/n"System Time "color w/n"with Server " color w+/n "$server" color w/n settime "$server" ;? " Applying Server comment" $=writevalue("$HKLMSCCS\Services\LanmanServer\Parameters","srvcomment", "Win2k $group @fullname",REG_SZ) ; ? " install Elron " if exist ("@lanroot\elronuam.dll")=0 and @ras=0 run "$logon\elron\uam_168_82_56_108_53_N.exe" $=Writeprofilestring("$server\logon\inventory\Install.log","Elron","@wksta","@date") endif endif if $os="WinNT" and $admin=1 ;? " Maintaining Administration of Workstation" $admincmd="cmd /c NET LOCALGROUP administrators fdhc\"+$group+"mis /add 1>Nul 2>&1" shell "$admincmd" ;? " Synchronizing "color c+/n"System Time "color w/n"with Server " color w+/n "$server" color w/n settime "$server" ;? " Applying "color c+/n"mm/dd/yyyy "color w/n"date setting" $=WRITEVALUE("HKEY_CURRENT_USER\Control Panel\International","sShortDate","MM/dd/yyyy",REG_SZ) ;? " Applying Server comment" $=writevalue("$HKLMSCCS\Services\LanmanServer\Parameters","srvcomment", "$group @fullname",REG_SZ) ;? " Verify and Clear DNS settings if DHCP Client indicated by value of 2" $dhcpservice=readvalue("$HKLMSCCS\services\dhcp","start") if $dhcpservice="2" $dnsserver=readvalue("$HKLMSCCS\services\tcpip\parameters","NameServer") if $dnsserver>" " $=writevalue("$HKLMSCCS\services\tcpip\parameters","NameServer","",REG_SZ) endif endif ;? " Configure and enforce Proxy settings" $ProxyServer="proxy.fdhc.state.fl.us:8080" $LMIntSettings="$HKLMSMWCV\Internet Settings" $CUIntSettings="$HKCUSMWCV\Internet Settings" ; $pbd=readvalue("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel","Proxy") $psv=readvalue("$CUIntSettings","ProxyServer") $pmv=readvalue("$LMIntSettings","ProxyServer") if $psv<>"$ProxyServer" or $pmv<>"$ProxyServer" $=writevalue("$LMIntSettings","ProxySettingsPerUser","0",REG_DWORD) $=writevalue("$LMIntSettings","ProxyServer","$ProxyServer",REG_SZ) $=writevalue("$LMIntSettings","ProxyEnable","1",REG_DWORD) $=writevalue("$LMIntSettings","ProxyOverride","<local>",REG_SZ) $=writevalue("$CUIntSettings","ProxySettingsPerUser","0",REG_DWORD) $=writevalue("$CUIntSettings","ProxyServer","$ProxyServer",REG_SZ) $=writevalue("$CUIntSettings","ProxyEnable","1",REG_DWORD) $=writevalue("$CUIntSettings","ProxyOverride","<local>",REG_SZ) $=writevalue("$HKCUS\Microsoft\Internet Explorer\Main","NoUpdateCheck","1",REG_DWORD) $=writevalue("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel","Proxy","1",REG_DWORD) endif ; ? " check for napster" if existkey("$HKLMS\napster")=0 $napdir=readvalue("$HKLMS\napster","InstallPath") $=sendmessage("$dcsa","Napster is detected on @wksta") $=Writeprofilestring("$logon\inventory\UnInstall.log","Napster","@wksta","@date") shell("%comspec% /c %windir%\unvise32.exe /s $napdir\uninstal.log") endif ; ? " Disable Autodial" $rasauto="$HKLMSCCS\Services\RasAuto" $autovalue=readvalue("$rasauto","Start") if @error=0 and $autovalue<>3 $=writevalue("$rasauto","Start","3",REG_DWORD) endif ; ? " Standard RAS Phonebook " if exist("c:\Program Files\IBM Global Network\IDialer.exe")=0 and exist("c:\Program Files\AT&T Global Network\IDialer.exe")=0 $rasdir="%windir%\system32\ras" $phonedate=comparefiletimes("$logon\rasphone.tag","$rasdir\rasphone.tag") $modemkey=readvalue("$HKLMS\Microsoft\RAS\TAPI DEVICES\Unimodem","Friendly Name") $modem=substr("$modemkey",1,instr("$modemkey","|")-1) if instr("$modem","Serial Cable")>0 $modem="" endif if ($phonedate=1 or $phonedate=-3) and $modem>"" copy "$logon\rasphone.pbk" "$rasdir" copy "$logon\rasphone.tag" "$rasdir" $=writeprofilestring("$rasdir\rasphone.pbk","Tallahassee Local","Device","$modem") $=writeprofilestring("$rasdir\rasphone.pbk","AHCA SunCom","Device","$modem") $=writeprofilestring("$rasdir\rasphone.pbk","AHCA Toll Free","Device","$modem") $hklmsmwcv="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" $namespace="Explorer\Desktop\NameSpace" $clsid="{a4d92740-67cd-11cf-96f2-00aa00a11dd9}" $=writevalue("HKEY_CLASSES_ROOT\CLSID\$clsid","","AHCA Dialup","REG_SZ") $=addkey("$hklmsmwcv\$namespace\$clsid") $=writevalue("$hklmsmwcv\$namespace\$clsid","","AHCA Dialup","REG_SZ") endif endif ;? " Connect H & S Drives for RAS Users" $rasdir="%windir%\system32\ras" if exist("$rasdir\rasphone.pbk") $rasdrivesdate=comparefiletimes("$logon\rasdrives.kix","$rasdir\rasdrives.kix") if $rasdrivesdate=1 or $rasdrivesdate=-3 shell "xcopy $logon\rasdrives.* $rasdir /q" $clkey="HKEY_CLASSES_ROOT\CLSID" $clsid="{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}" $clnam="Connect H & S Drives" $clico="$rasdir\rasdrives.ico" $clcmd="$rasdir\rasdrives.cmd" $=addkey("$clkey\$clsid") $=addkey("$clkey\$clsid\DefaultIcon") $=addkey("$clkey\$clsid\InProcServer32") $=addkey("$clkey\$clsid\Shell") $=addkey("$clkey\$clsid\Shell\Connect") $=addkey("$clkey\$clsid\Shell\Connect\Command") $=addkey("$clkey\$clsid\ShellEx") $=addkey("$clkey\$clsid\ShellEx\PropertySheetHandlers") $=addkey("$clkey\$clsid\ShellEx\PropertySheetHandlers\$clsid") $=addkey("$clkey\$clsid\ShellEx\ShellFolder") $=writevalue("$clkey\$clsid","","$clnam","REG_SZ") $=writevalue("$clkey\$clsid\DefaultIcon","","$clico","REG_SZ") $=writevalue("$clkey\$clsid\InProcServer32","","shell32.dll","REG_SZ") $=writevalue("$clkey\$clsid\InProcServer32","ThreadingModel","Apartment","REG_SZ") $=writevalue("$clkey\$clsid\Shell\Connect\Command","","$clcmd","REG_SZ") $=writevalue("$clkey\$clsid\ShellFolder","Attributes","0","REG_DWORD") ; ************ Creates the desktop icon ************************ ? " Setting Connect H & S Desktop Icon" $=addkey("$HKLMSMWCV\Explorer\Desktop\NameSpace\$clsid") endif endif ; ? " install Elron " if exist ("@lanroot\elronuam.dll")=0 and @ras=0 run "$logon\elron\uam_168_82_56_108_53_N.exe" $=Writeprofilestring("$logon\inventory\Install.log","Elron","@wksta","@date") endif endif if $os="Win2k" ;? " Applying "color c+/n"Internet Home Page "color w/n"setting" $=writevalue("$HKCUS\Microsoft\Internet Explorer\main","start page","http://ahcaweb/","REG_SZ") endif if $os="WinNT" ;? " Applying "color c+/n"Internet Home Page "color w/n"setting" $=writevalue("$HKCUS\Microsoft\Internet Explorer\main","start page","http://ahcaweb/","REG_SZ") ;? " Invalidate shortcuts" $=writevalue("$HKCUSMWCV\Policies\Explorer","LinkResolveIgnoreLinkInfo","1","REG_SZ") $=writevalue("$HKCUSMWCV\Policies\system","NoDispScrSavPage","0",REG_SZ) if ingroup("Area_Fraes")=1 if existkey("$HKLMSMWCV\Uninstall\Webshots")=0 $remove=readvalue("$HKLMSMWCV\Uninstall\Webshots","UninstallString") shell("$remove") $=Writeprofilestring("$logon\inventory\Uninstall.log","WebShots","@wksta","@date") endif ;Set default screensaver with 5 minute time out $=writevalue("$HKCPCPD","ScreenSaveActive","1","REG_SZ") $=writevalue("$HKCPCPD","ScreenSaverIsSecure","1","REG_SZ") $=writevalue("$HKCPCPD","ScreenSaveTimeOut","300","REG_SZ") $=writevalue("$HKCPCPD","ScrnSave.exe","%windir%\System32\Logon.scr","REG_SZ") $=writevalue("$HKCUSMWCV\Policies\system","NoDispScrSavPage","1",REG_SZ) endif endif return ;******************************************* end of GroupPolicy ********************************************************** ;************************************************************************************************************************* ;******************************************* start of GroupDrives ******************************************************** :GroupDrives shell "%comspec% /c net use * /delete /y 1>Nul 2>&1" if ingroup("Areamis") use f: "$server\e$$" use Y: "\\ITSS\itss" ? color c+/n " MIS Global Group" color w/n " drives " color w+/n "F: Y:" color w/n endif if ingroup("MCHQ_RN") use m: "\\c1dm3\QOCMonitors" ? color c+/n " QOC Global Group" color w/n " drives " color w+/n "M:" color w/n endif if ingroup("Compass") use i: "\\fdhctlh10\Flstatutes" ? color c+/n " Compass Global Group" color w/n " drives " color w+/n "I:" color w/n endif if ingroup("Area_Impromptu") use e: "\\FDHCTLH13\CAU" use g: "\\c1dm3\INSP_HQA" use z: "\\FDHCTLH13\MISAPPS" ? color c+/n " Impromptu Global Group" color w/n " drives " color w+/n "E: G: Z:" color w/n endif if ingroup("Area_DMS") use m: "\\c1dm3\dma$area" ? color c+/n " Disease Management Global Group" color w/n " drives " color w+/n "M:" color w/n endif if ingroup("Area_HMO") use n: "\\c1dm3\hmo" ? color c+/n " HMO WC&C Unit Nurses Global Group" color w/n " drives " color w+/n "N:" color w/n endif if ingroup("Area_legal") use l: "\\itss\pmwin" ; L & M are required for Practice Manager use m: "\\c1dm3\pmwin" use t: "\\mad\westpub" ; T & U are required for Premise/Westpub use u: "\\oagcdwins\ahcce1$$" use q: "\\fdhctlh10\cch" ; Q, R, & W are required for CCH use r: "\\fdhctlh10\cchkar02" use w: "\\fdhctlh10\cchkar03" use v: "\\mad\shepards" ; V is required for Shepards ? color c+/n " Legal Group"color w/n " drives "color w+/n "Q: R: T: U: V: W:"color w/n endif if ingroup("Area_FireSafety") ; MCHQ Fire Safety Surveyors use f: "\\fdhctlh10\nfc" ? color c+/n " Fire Safety Group"color w/n " drives "color w+/n "F:"color w/n endif if ingroup("Area_OIG") use f: "\\c1dm3\mpi_shared" use k: "\\c1dm3\adhoc_req" ? color c+/n " OIG Group"color w/n " drives "color w+/n "E: F: K:"color w/n endif if ingroup("mpd-area") use t: "\\c1dm3\mpd_shared" ? color c+/n " Medicaid Field Ops"color w/n " drives "color w+/n "T:"color w/n endif if ingroup("mchq_reports") or ingroup("ltcqa") use k: "\\c1dm3\adminacts" ? color c+/n " MCHQ Reports & Database"color w/n " drives "color w+/n "K:"color w/n endif Return ;******************************************* end of GroupDrives ********************************************************** ;************************************************************************************************************************* ;******************************************* start of GroupApps ********************************************************** :GroupApps if @ras=0 and $admin=1 ;Do not run section if dialed up or not local admin on N ; ****************************** FL Legal Research Tools ***************************************** if ingroup("compass") use i: "\\fdhctlh10\Flstatutes" if exist("C:\FLTOOLS\BVIEWS.EXE")=0 ? " Installing Florida Statutes program" $Button=Messagebox("The new FL Legal Research Tools are now being installed", "Message from MIS",0) $Button=Messagebox("You will be required to answer a couple of option windows", "Message from MIS",0) $Button=Messagebox("Click OK on every option window", "Message from MIS",0) $Button=Messagebox("The install will start as soon as you close this window", "Message from MIS",0) shell "i:\comset" sleep 20 $=Messagebox("Thank You", "Message from MIS",0) copy "$startmenu\Programs\FL Legal Research Tools\*.*" "$Desktop" endif endif ; ******************************* Install Impromptu ********************************* $imp6bindir=readvalue("$HKLMS\Cognos\cer1\Rendition Locations","Programs") $imp6path="$setup\Apps\impromptu6" $inf32dir=enumvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Informix\Setup\InstalledDirectories", 0) if exist("c:\cognos")=1 and ingroup("$group"+"mis")=0 and exist("$inf32dir")=1 ? " Removing Old Impromptu" if exist("$server\hqa\home\@userid") md "$server\hqa\home\@userid\Impromptu" endif copy "c:\cognos\bi96\workspce\*.imr" "$server\hqa\home\@userid\Impromptu" if @error>0 ? " Home dir not found, coping reports to temp folder on C: drive" md "c:\imrtemp" copy "c:\cognos\bi96\workspce\*.imr" "c:\imrtemp" endif shell "%comspec% /c rd /s /q c:\cognos" $=delprogramgroup("Cognos",1) del "$alldesktop\improm~2.lnk" $=Writeprofilestring("$logon\inventory\unInstall.log","Impromptu","@wksta","@date") endif if ingroup("area_impromptu")=1 and exist("C:\Program Files\Cognos\cer1\bin\impuser.exe")=0 and exist("$imp6bindir")=0 and exist("$inf32dir")=1 ? " Please wait for Impromptu 6 to install" shell "%comspec% /c $imp6path\Cognos\Impromptu\xwsetup.exe /s $imp6path\Cognos\Impromptu\response.ini" $imp6bindir=readvalue("$HKLMS\Cognos\cer1\Rendition Locations","Programs") copy "$imp6path\impromptu.ini" "$imp6bindir" copy "\\fdhctlh13\misapps\IMPT V6.0\TEMPLA~1\*.*" "C:\Program Files\Cognos\Cer1\bin\User Workspace" copy "$startmenu\programs\Cognos~1\Cognos~1.lnk" "$desktop" $=writevalue("$HKCUS\Informix\Environment","DBANSIWARN","n",REG_SZ) $=writevalue("$HKCUS\Informix\Environment","DELIMIDENT","n",REG_SZ) $=writevalue("$HKCUS\Informix\Environment","INFORMIXDIR","C:\informix",REG_SZ) $=writevalue("$HKCUS\Informix\Environment","InformixServer","production",REG_SZ) $=addkey("$HKCUS\Informix\netrc\ahcaprod") $=writevalue("$HKCUS\Informix\netrc\ahcaprod","","",REG_SZ) $=writevalue("$HKCUS\Informix\netrc\ahcaprod","AskPassword","P",REG_SZ) $=writevalue("$HKCUS\Informix\netrc\ahcaprod","USER","@userid",REG_SZ) $=addkey("$HKLMS\Informix\SqlHosts") $=addkey("$HKLMS\Informix\SqlHosts\production") $=writevalue("$HKLMS\Informix\SqlHosts\production","HOST","ahcaprod",REG_SZ) $=writevalue("$HKLMS\Informix\SqlHosts\production","PROTOCOL","onsoctcp",REG_SZ) $=writevalue("$HKLMS\Informix\SqlHosts\production","SERVICE","production",REG_SZ) $=Writeprofilestring("$logon\inventory\Install.log","Impromptu6","@wksta","@date") endif if ingroup("area_impromptu")=0 and exist("$imp6bindir")=1 and ingroup("$group"+"mis")=0 ? " UnInstalling imp6" shell '"C:\Program Files\Common Files\Cognos Shared\cer1\Uninstall\uninst.exe" /u "C:\Program Files\Common Files\Cognos Shared\cer1\Uninstall\uninst.ini"' $=Writeprofilestring("$logon\inventory\UnInstall.log","Impromptu6","@wksta","@date") $=delprogramgroup("Cognos BI Silent",0) $=del "$desktop\cognos~1.lnk" endif if ingroup("area_impromptu")=1 and exist("c:\program files\cognos\cer1\bin\impuser.exe")=1 ? " Impromptu 6 ini files being copied" shell 'xcopy "$imp6path\*.ini" "$imp6bindir" /r' endif ; ************************* Install Metaframe ******************************* If ingroup("Area_MetaFrame")=1 and exist("C:\PROGRAM FILES\Citrix\ICA CLIENT\Uninst.isu")=0 ? " Installing Citrix Metaframe" Shell "$setup\apps\Metaframe\Setup.exe -s" $=Writeprofilestring("$logon\inventory\Install.log","Metaframe","@wksta","@date") sleep 20 endif ; ******************* Remove metaframe from unnecessary PCs ****************** If ingroup("Area_MetaFrame")=0 and exist("C:\PROGRAM FILES\Citrix\ICA CLIENT\Uninst.isu")=1 and Ingroup("areamis")=0 ? " Uninstalling Citrix Metaframe" $UnstKey=ReadValue("$HKLMSMWCV\Uninstall\Citrix ICA Client","UninstallString") Shell "$UnstKey" $=Writeprofilestring("$logon\inventory\UnInstall.log","Metaframe","@wksta","@date") endif ; ************************* Install QueryPath ******************************* If ingroup("Area_QueryPath")=1 $QPexe="C:\Program Files\Consultec\QueryPath\Client.exe" $QPins=getfileversion("$QPexe") if exist("$QPexe")=1 and $QPins<>$QPcurrent ? " Uninstalling old version of Querypath" Shell 'cmd /c C:\WINNT\uninst.exe -y -a -f"C:\Program Files\Consultec\QueryPath\DeIsL1.isu" -cC:\PROGRA~1\CONSUL~1\QUERYP~1\_ISREG32.DLL' endif if exist("$QPexe")=0 ? " Installing QueryPath" Shell "\\lobster\software\QueryPath\Client\Setup.exe -s" Shell "regedit /s \\lobster\software\QueryPath\Client\dcom.reg" $=Writeprofilestring("$logon\inventory\Install.log","QueryPath","@wksta","@date") $QPins=getfileversion("$QPexe") endif ? " Installed "color c+/n"QueryPath "color w/n"is version " color w+/n $qpins color w/n endif ; ********************** Install business Objects **************************** If ingroup("Area_BusObjects")=1 and exist("C:\Program Files\Business Objects\BusinessObjects 5.0\Busobj.exe")=0 ? " Installing Business Objects" sendmessage("@userid","The Business Objects install will take about 15-20 minutes") Shell "\\lobster\software\BusObj5\setup\setup.exe -s -skip -key BJ2R-D6RMG-GPKG -rdbmskey H62N-D67U6-PU95" $=Writeprofilestring("$logon\inventory\Install.log","BusinessObjects","@wksta","@date") copy "\\lobster\software\BusObj5\security\*.*" "C:\Program Files\Business Objects\BusinessObjects 5.0\LocData" copy "C:\WINNT\Profiles\All Users\Start Menu\Programs\BusinessObjects 5.0\busine~1.lnk" "$Desktop" del "C:\Program Files\Business Objects\BusinessObjects 5.0\Universe\*.unv" del "C:\Program Files\Business Objects\demo\*.*" endif ; ********************** Install Oracle **************************** If ingroup("Area_BusObjects") or ingroup("$group"+"cts") $Orapath="$setup\clients\Oracle8" $ora=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE","ORACLE_HOME") $oraver=getfileversion("$ora"+"\bin\n8sw.exe") ? " Oracle Version is "color y+/n"$oraver" color w/n if $oraver<$O8current and exist("$Orapath\sms\cltappnt.bat") ? " Updating Oracle Client" use v: "$setup" go v: cd "v:\clients\Oracle8\sms" shell "cltappnt.bat" $=Writeprofilestring("$logon\inventory\Install.log","Oracle","@wksta","@date") endif $ora=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE","ORACLE_HOME") $tnstime=comparefiletimes("$Orapath\tnsnames.ora","$ora\net80\admin\tnsnames.ora") if $tnstime=1 or $tnstime=-3 copy "$Orapath\tnsnames.ora" "$ora\net80\admin" ? color g+/n" Updating Oracle Datasources"color w/n endif endif endif return ;******************************************* end of GroupApps ************************************************************ ;************************************************************************************************************************* ;******************************************* start of UpdateApps ********************************************************* :UpdateApps if @ras=0 ; Section will not run if dialed in ; **************************** Internet Explorer Section ************************************* $ier=readvalue("$HKLMS\Microsoft\Internet Explorer", "Version") ? " Installed "color c+/n"Internet Explorer"color w/n" is version "color w+/n $ier color w/n $enc=readvalue("$HKLMSCCS\Control\SecurityProviders","Domestic Security Version") If $Admin=1 and (@error>0 or $enc<"4.87") shell "$setup\Apps\IE128bit\ie501dom.exe /R:N /Q:A /N:V" $=Writeprofilestring("$logon\inventory\Install.log","IE128bit","@wksta","@date") endif ; ****************************** MSOffice version ***************************************** $MSOdir=readvalue("$HKLMSMWCV\App Paths\excel.exe","Path") if exist("$MSOdir\excel.exe") $excel=getfileversion("$MSOdir\excel.exe") select case $excel=8.0a $esr="97 SR-1" case $excel=8.0e $esr="97 SR-2" case $excel=9.0.2719 $esr="2000" case $excel=9.0.3822 $esr="2000 SR-1a" case $excel=9.0.4430 $esr="2000 SR-2" endselect ? " Installed "color c+/n"MS Office "color w/n"is version " color w+/n "$esr" color w/n endif if exist("$MSOdir\msaccess.exe") $access=getfileversion("$MSOdir\msaccess.exe") select case $access=8.0.3512 $asr="97 SR-0" case $access=8.0.4122 $asr="97 SR-1" case $access=8.0.5903 $asr="97 SR-2" case $access=9.0. $asr="2000" case $access=9.0.3822 $asr="2000 SR-1a" case $access=9.0.4506 $asr="2000 SR-2" endselect ? " Installed "color c+/n"MS Access " color w/n"is version "color w+/n $asr color w/n endif if exist("$MSOdir\mspub.exe") $pub=getfileversion("$MSOdir\mspub.exe") select case $pub=4.0 $psr="97" case $pub=5.0 $psr="98" case $pub=6.0 $psr="2000" endselect ? " Installed "color c+/n"MS Publisher " color w/n"is version "color w+/n $psr color w/n endif ; ****************************** Configure Outlook ******************************** $MsgKey = "$HKCUSMWNTCV\Windows Messaging Subsystem\Profiles" $MProfile = ReadValue($MsgKey, "DefaultProfile") ;Read the current default profile IF $MProfile = "" and $os="WinNT" ;If there is not default profile, create the profile using the PRF $ExFileLoc = "c:" ;Location to copy temp file to $copysource = "$logon\newprof.prf" ;name of the template prf $File = "$ExFileLoc\newprof.PRF" ;Custom profile filename $exserver = "areamail" ;name of mailserver DEL "$File" ;Deletes any existing PRF file COPY "$copysource" "$exfileloc" ;Copies baseline PRF file to c: $section = "General" $ = WRITEPROFILESTRING ($FILE, $section, "Custom", "1") $ = WRITEPROFILESTRING ($FILE, $section, "ProfileName", "@UserID") $ = WRITEPROFILESTRING ($FILE, $section, "DefaultProfile", "Yes") $ = WRITEPROFILESTRING ($FILE, $section, "OverwriteProfile", "No") $ = WRITEPROFILESTRING ($FILE, $section, "DefaultStore", "Service2") $section = "Service List" $ = WRITEPROFILESTRING ($FILE, $section, "Service1", "Microsoft Outlook Client") $ = WRITEPROFILESTRING ($FILE, $section, "Service2", "Microsoft Exchange Server") $ = WRITEPROFILESTRING ($FILE, $section, "Service3", "Outlook Address Book") $section = "Service2" $ = WRITEPROFILESTRING ($FILE, $section, "HomeServer", "$exserver") $ = WRITEPROFILESTRING ($FILE, $section, "MailBoxName", "@userid") $ = WRITEPROFILESTRING ($FILE, $section, "OfflineAddressBookPath", "%userprofile%\Local Settings\Application Data\Microsoft\Outlook") $section = "Service3" $ = WRITEPROFILESTRING ($FILE, $section, "Ben", "True") $section = "Service4" $ = WRITEPROFILESTRING ($FILE, $section, "Ben", "True") ? " Creating New Outlook Profile..." SHELL "$logon\newprof.exe -P $File -x" ;Creates the Messaging profile DEL "$File" ;Delete temp file ENDIF ; ****************************** Adobe Acrobat Reader 4.0 ************************************** $acrobat="C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe" $acrover=getfileversion("$acrobat") if exist("$acrobat")=0 or $acrover<$arcurrent shell "$setup\apps\acrobat\setup.exe -s" $=Writeprofilestring("$logon\inventory\Install.log","Acrobat","@wksta","@date") else ? " Installed "color c+/n"Acrobat Reader "color w/n"is version " color w+/n $acrover color w/n endif ; ******************************* McAfee NetShield Section *********************************** if $os="WinNT" if existkey("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\VirusScan")<>0 ? color r+/n " McAfee NetShield is not installed" color w/n shell("$setup\apps\mcafee\$os\install\setup.exe -s") else $runscan=0 $datupdate=0 $DatPath="$setup\apps\mcafee\WinNT\Update" $EngPath="$setup\apps\mcafee\WinNT\Upgrade" $=WRITEVALUE("$HKLMSCCS\Services\AlertManager","ObjectName","LocalSystem",REG_SZ) $=WRITEVALUE("$HKLMSCCS\Services\McTaskManager","ObjectName","LocalSystem",REG_SZ) ; **************************** Upgrade Engine Section ********************************** ? " Installed "color c+/n"McAfee NetShield "color w/n"is version " color w+/n $prd color w/n " engine "color w+/n $eng color w/n if $eng<$McEngine $=WRITEVALUE("$McAfeeEngKey", "szUpdateUncLocation", "$EngPath", "REG_SZ") $=WRITEVALUE("$McAfeeEngKey", "uUpdateFrom", "1", "REG_DWORD") ? color g+/n" The Antivirus Program on your computer is being updated" color w/n shell "$engpath\$mceng" $runscan=1 endif ; ******************************* Upgrade DAT Section *********************************** ? " Installed "color c+/n"McAfee DAT "color w/n"is version " color w+/n $dat color w/n " dated " color w+/n $Mcdate color w/n $datver1=substr("$dat",5,4) $datver2=substr("$dat",3,4) $datver=$datver2 if instr("$datver1",".")=0 $datver=$datver1 endif $datfile=dir("$datpath\dat*.zip") while $datfile<>"" and @error=0 and $datupdate=0 $datfilever=substr("$datfile",5,4) if $datfilever>$datver ? color g+/n" Updating Antivirus signatures" color w/n $=WRITEVALUE("$McAfeeRegKey"+"\Tasks\Update", "szUpdateUncLocation", "$DatPath", "REG_SZ") $=WRITEVALUE("$McAfeeRegKey"+"\Tasks\Update", "uUpdateFrom", "1", "REG_DWORD") shell "$mcexe /task update" $runscan=1 $datupdate=1 ; ************************* Alert Recipients Section ********************* $Rep='Priority Level:"1" Type:"Network Message" Recipient:"\\' $=writevalue("$McAfeeAltKey","Recipient0","$rep"+$dcsa+chr(34),"REG_SZ") $=delvalue("$McAfeeAltKey","Recipient1") endif $datfile=dir() loop ; ********************************* Extra DAT Section ************************************ $dattime=comparefiletimes("$datpath\extra.dat","$datdir"+"extra.dat") if $dattime=-3 or $dattime=1 shell("%comspec% /c net stop mcshield >nul") copy "$datpath\extra.dat" "$datdir" if @error=0 $runscan=1 endif shell("%comspec% /c net start mcshield >nul") endif ; *********************** Run Silent Scan Section ***************************** if $runscan=1 run ("$scanner /uinone /clean /delete /exit") ? color g+/n " Starting Virus Scan" color w/n endif endif endif ; ************************************** Oracle Section *************************************** $ora=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE","ORACLE_HOME") $oraver=getfileversion("$ora\bin\n8sw.exe") if exist("$ora\bin\n8sw.exe") ? " Installed "color c+/n"Oracle "color w/n"version is "color w+/n"$oraver" color w/n endif ; ************************************** Winzip Section *************************************** if existkey("$HKLMSMWCV\App Paths\Winzip32.exe")=0 $zip=readvalue("$HKLMSMWCV\App Paths\Winzip32.exe","") $Winzipver=getfileversion("$zip") ? " Installed "color c+/n "Winzip "color w/n"version is "color w+/n"$winzipver" color w/n endif ; ************************************** Aspen Section *************************************** $asekey="HKEY_LOCAL_MACHINE\SOFTWARE\Alpine Technology Group\ASPEN Survey Explorer" $aseinstall="$setup\apps\ase" $asepath="C:\Program Files\ASE" if $dept="HQA" or exist("$asepath\ase.exe")=1 ; ************************************* ASE 4.0 Upgrade *************************************** if existkey("$asekey")=0 $asefiletime=getfiletime("$asepath\ase.exe") if instr("$asefiletime","2001/03/22")=0 sendmessage("@userid"," You are being upgraded to the newest version of Aspen. This will go on for about 3 minutes AFTER the logon script finishes. Click the OK button(s) when prompted.") shell("$aseinstall\setup.exe -s") sleep 15 $=Writeprofilestring("$logon\inventory\Install.log","ASE 4.0","@wksta","@date") endif endif ;********************************* Install OASIS List HHA Reports Plugin ************************ $ieplugplus="C:\Program Files\Plus!\Microsoft Internet\PLUGINS" $ieplugpath="C:\Program Files\Internet Explorer\PLUGINS" if exist("$ieplugpath")=0 $ieplugpath="$ieplugplus" endif if exist("$ieplugpath\npdwe70.dll")=0 copy "$setup\apps\OASIS Plugin\*.dll" "$ieplugpath" endif if exist("$desktop\oasisl~1.url")=0 and $dept<>"MIS" copy "$setup\apps\OASIS Plugin\oasisl~1.url" "$favorites" copy "$setup\apps\OASIS Plugin\oasisl~1.url" "$desktop" endif endif endif return ;******************************************* end of UpdateApps *********************************************************** ;************************************************************************************************************************* ;******************************************* start of Inventory ********************************************************** :Inventory if @ras=0 if exist("$logon\inventory\@year @month Hardware.csv")=0 if exist("$logon\inventory\Inventory History")=0 shell '%comspec% /c MD "$logon\inventory\Inventory History"' shell '%comspec% /c MOVE $logon\inventory\*.csv "$logon\inventory\Inventory History"' endif $=Writeprofilestring("$logon\inventory\@year @month Hardware.csv","Hardware Inventory","ComputerName",$c+"Username"+$c+"PositionNumber"+$c+"Department"+$c+"Manufacturer"+$c+"Model"+$c+"Case"+$c+"SerialNumber"+$c+"BiosVersion"+$c+"ProcessorSpeed"+$c+"Proces sorType"+$c+"Dimm1"+$c+"Dimm2"+$c+"Dimm3"+$c+"Modem") endif if exist("$logon\inventory\@year @month Software.csv")=0 $=Writeprofilestring("$logon\inventory\@year @month Software.csv","Software Inventory","ComputerName",$c+"Username"+$c+"PositionNumber"+$c+"Department"+$c+"OperatingSystem"+$c+"ServicePack"+$c+"MicrosoftOffice"+$c+"MicrosoftAccess"+$c+"MicrosoftPublisher"+ $c+"InternetExplorer"+$c+"McAfeeAntivirus"+$c+"McAfeeEngine"+$c+"McAfeeDAT"+$c+"Oracle"+$c+"Winzip"+$c+"Impromptu"+$c+"Aspen") endif $=Writeprofilestring("$logon\inventory\@year @month Hardware.csv","Hardware Inventory","@wksta","$c@userid$c$positionnum$c$dept$c$Make$c$Model$c$Case$c$SerNo$c$Biosv$c$CPUsp$c$CPUfm$c$dimm1$c$dimm2$c$dimm3$c$modem") $=Writeprofilestring("$logon\inventory\@year @month Software.csv","Software Inventory","@wksta","$c@userid$c$positionnum$c$dept$c$os$c$ossubver$c$esr$c$asr$c$psr$c$ier$c$prd$c$eng$c$dat$c$OraVer$c$Winzipver$c$Impver$c$asefiletime") endif Return ;******************************************* end of Inventory ************************************************************
|
|
Top
|
|
|
|
#10788 - 2001-07-26 11:44 AM
Re: Inventory Script for all OS's!
|
Anonymous
Anonymous
Unregistered
|
Radimus,...Your script looks really OK! Nice piece of code. But it's a complete logon script, not only a inventory... Grtxx, Kira
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2175 anonymous users online.
|
|
|