Hello All,
I'm new to the world of kix as we have finally managed to enable logon scripts at our site. This is a great step forward for us as we have had allot of push back in the past from management.
Anyway enough about my mental problems
onward with the kix!
Well my issue is my inventory script which I have made from other peoples scripts and modified for my own use is having some issues on our desktops.
Little about our environment, Windows 2000, SP3 & SP4 with most patches applied.
And worm patches etc. mostly our users aren’t & Can’t be local administrators of there machines.
Anyway kix has been working wonderfully for me thus far but with my inventory script strange things happen. At first I made a similar version of this in VBScript but it seems I’m having the same problems which are.
1) Logged on as a normal user the PC’s Internet Explorer 6 w/sp1 works first time then you close the app and open it again and it says “Detecting proxy settings” and just sits there forever and you have to reboot again for it to work. If you’re lucky.
2) After the internet explorer starts playing up I can’t get into control panel its like the whole “explorer” craps out.
3) The Computer Generally becomes unstable, SAP plays up Outlook doesn’t work media player etc.
4) If I load a patch on the machines which is MS04-011 Latest updates. (May/June) I think it is, and make the user a local administrator everything’s fine. If I load this patch and don’t make the local user an administrator it still doesn’t work properly ie: Media player doesn’t load internet explorer still has issues.
Making all our users local Admin’s isn’t an option for us. So I’m guessing it has to be something with the script which is causing the hassle.
Or something I’m doing somewhere, So hears my script if you could have a look over it and see if you can find anything that might be contributing to this issue please let me know! Btw: I’m using kixtart 2001 4.21
Code:
; SetConsole("HIDE")
; SetOption("Explicit","ON")
break on
;Declare global variables for script
Global $sysid, $WinMgt, $LastInvDate, $RunInterval, $NextRun, $Item, $i, $iValue
;More variables
Dim $CompSys, $OpSys, $Bios, $Environment, $Drives, $CPU, $Chassis, $IP, $objCPUSet, $objCPU
Dim $Name, $Manufacturer, $Model, $Memorysize, $SerialNumber, $Statenumber, $Chassistype
Dim $CPUSpeed, $CPUManufacturer, $CPUDescription, $L2CacheSize, $CPUVersion, $CPUNUMBER
Dim $nwrite, $HD, $HDGB, $hdMBfr, $Video, $what, $where, $videotype, $hdsize, $videoram, $videoramsize
Dim $videoramsizeis, $CPUSPD, $CPUMAN, $CPUL2, $ramsize, $ramsizei, $monitortype, $montype
Dim $IsLocalAdmin, $MONPNPDev, $MONDev, $ieversion, $virusdef, $viruseng, $docuver
; "starting WMI"
; Getting information from WMI, and setting them as variable.
$WinMgt = GetObject("winmgmts:")
$CompSys = $WinMgt.ExecQuery("Select * from Win32_ComputerSystem")
For Each $item In $CompSys
$NAME = $item.Name
$MANUFACTURER = $item.manufacturer
$MODEL = $item.model
$MEMORY = $item.TotalPhysicalMemory
$CPUNUMBER = $item.NumberOfProcessors
Next
; "COMPSYS"
$Bios = $WinMgt.ExecQuery("Select SerialNumber from Win32_bios")
For Each $item In $bios
$SERIALNUMBER = $item.serialnumber
Next
$Environment = $WinMgt.Execquery("Select VariableValue from win32_environment where name = 'stateno'")
For Each $item In $Environment
$StateNumber = $item.VariableValue
Next
$Chassis = $WinMgt.ExecQuery("Select ChassisTypes from Win32_SystemEnclosure")
For Each $item In $Chassis
$CHASSISTYPE = $item.ChassisTypes(0)
Next
$video = $WinMgt.ExecQuery("Select Description from Win32_VideoController")
For Each $item In $video
$videotype = $item.description
next
$videoram = $WinMgt.ExecQuery("Select AdapterRAM from Win32_VideoController")
For Each $item In $videoram
$videoramsize = $item.AdapterRAM
next
$HD = $WinMgt.ExecQuery("Select Size from Win32_DiskDrive")
For Each $item In $HD
$hdsize = $item.Size
next
$videoramsizeis = $videoramsize/1024
$hdGB = left($hdsize,len($hdsize)-9)
$hdMBfr = GetDiskSpace("c:")/1000
$CPUSPD = $WinMgt.ExecQuery("Select CurrentClockSpeed from Win32_Processor")
For Each $item In $CPUSPD
$CPUSPEED = $item.CurrentClockSpeed
next
$CPUMan = $WinMgt.ExecQuery("Select Name from Win32_Processor")
For Each $item In $CPUMAN
$CPUManufacturer = $item.Name
next
$CPUL2 = $WinMgt.ExecQuery("Select L2CacheSize from Win32_Processor")
For Each $item In $CPUL2
$L2CacheSize = $item.L2CacheSize
next
$montype = $WinMgt.ExecQuery("Select MonitorType from Win32_DesktopMonitor")
For Each $item In $montype
$monitortype = $item.MonitorType
next
$mondev = $WinMgt.ExecQuery("Select PNPDeviceID from Win32_DesktopMonitor")
For Each $item In $mondev
$monpnpdev = $item.PNPDeviceID
next
$viruseng = ReadValue("HKEY_LOCAL_MACHINE\software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc.", "EngineZipVer")
$virusdef = ReadValue("HKEY_LOCAL_MACHINE\software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc.", "PatternVer")
$ieversion = ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version")
$docuver = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Documentum Desktop Client 4.3.2", "DisplayName")
If InGroup("\\" + @WKSTA + "\Administrators")
$IsLocalAdmin = "True"
Else
$IsLocalAdmin = "False"
Endif
IF Open( 3 , "C:\COMP_INFO.TXT" , 5 ) = 0
$x = writeline( 3 , "Computer System Inventory Information" + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "User Information" + @CRLF )
$x = writeline( 3 , "Inventory Completed On: " + @TIME + " " + @DATE + @CRLF )
$x = Writeline( 3 , "Computer Name: " + @WKSTA + @CRLF )
$x = Writeline( 3 , "Users Logon Domain: " + @LDOMAIN + @CRLF )
$x = writeline( 3 , "Users Logon ID: " + @USERID + @CRLF )
$x = Writeline( 3 , "Users SID: " + @SID + @CRLF )
$x = Writeline( 3 , "Password Age: " + @PWAGE + @CRLF )
$x = Writeline( 3 , "Users Full Name: " + @FULLNAME + @CRLF )
$x = Writeline( 3 , "Users Account Discription: " + @COMMENT + @CRLF )
$x = Writeline( 3 , "User Has Local Admin Priv:" + $Islocaladmin + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "Computer Hardware Information" + @CRLF )
$x = Writeline( 3 , "Computer Name: " + @WKSTA + @CRLF )
$x = Writeline( 3 , "Manufacturer: " + $Manufacturer + @CRLF )
$x = Writeline( 3 , "Model: " + $Model + @CRLF )
$x = Writeline( 3 , "Memory: " + $MEMORY + " Bytes" + @CRLF )
$x = Writeline( 3 , "Serial Number: " + $Serialnumber + @CRLF )
$x = Writeline( 3 , "CPU Manufacturer: " + $CPUManufacturer + @CRLF )
$x = Writeline( 3 , "CPU Speed: " + $CPUSpeed + "Mhz" + @CRLF )
$x = Writeline( 3 , "CPU Level 2 Cache: " + $L2CacheSize + " KBytes"+ @CRLF )
$x = Writeline( 3 , "CPU's Installed: " + $CPUNumber + @CRLF )
$x = Writeline( 3 , "Chassis Type: " + $ChassisType + @CRLF )
$x = writeline( 3 , "HDD Capacity: " + $hdGB + "Gb" + @CRLF )
$x = Writeline( 3 , "HDD Free Space: " + $hdmbfr + " MBytes"+ @CRLF )
$x = Writeline( 3 , "Video Card: " + "$videotype" + @CRLF )
$x = Writeline( 3 , "Video Card RAM: " + $videoramsizeis + " KBytes" + @CRLF )
$x = Writeline( 3 , "Monitor Discription:" + $Monitortype + @CRLF )
$x = Writeline( 3 , "Monitor PNPDeviceID:" + $MONPNPDev + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "TrendMicro Antivirus Information" + @CRLF )
$x = Writeline( 3 , "Definition Version:" + $virusdef + @CRLF )
$x = Writeline( 3 , "Virus Scan Engine:" + $viruseng + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "Logon Server: " + @LSERVER + @CRLF )
$x = Writeline( 3 , "Script Directory: " + @SCRIPTDIR + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "Site : " + @SITE + @CRLF )
$x = Writeline( 3 , "Workstation Name: " + @WKSTA + @CRLF )
$x = Writeline( 3 , "Name: " + $Name + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "Host Name: " + @HOSTNAME + @CRLF )
$x = Writeline( 3 , "IP Address: " + @IPADDRESS0 + @CRLF )
$x = Writeline( 3 , "IP GATEWAY: " + @EnumIpinfo + @CRLF )
$x = Writeline( 3 , "MAC Address: " + @ADDRESS + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "MISC. Computer System Information" + @CRLF )
$x = Writeline( 3 , "Computer OS: " + @PRODUCTTYPE + @CRLF )
$x = Writeline( 3 , "Computer OS Service Pack: " + @CSD + @CRLF )
$x = Writeline( 3 , "Internet Explorer Version:" + $IEVERSION + @CRLF )
$x = Writeline( 3 , "Documentum Version:" + $DOCUVER + @CRLF )
$x = writeline( 3 , "_____________________________________________________________" + @CRLF)
$x = Writeline( 3 , "Privilege: " + @PRIV + @CRLF )
$x = Writeline( 3 , "User Language: " + @USERLANG + @CRLF )
Else
BEEP
? "Filed to Open : [" + @ERROR + "]"
ENDIF
Thanks for your help, By the way if I disable my inventory script all the computers work perfectly so it kind of says its the script causing the problems...
Thanks
Quenten