Here is a script to attempt to determine the Manufacturer/System Chassis Type/and Serial Number

Most Admins seem to want to know how many systems are Laptops. This code should work well for recent systems. Older systems may not return data correctly.

Requires WMI
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0 SP4 and later.
Server: Included in Windows Server 2003, Windows 2000 Server, Windows NT Server 4.0 SP4 and later.

This is based on the discussion from this posting.
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=004588

The WMIQuery UDF is a modified version of the one from Radimus. This version is from Lonkero.
The main script idea is from Kent.






DIM $Set1, $Set2, $CaseType, $SystemType,$SerialNumb,$Mfg
$Set1=SetOption('Explicit','ON')
$Set2=SetOption('NoVarsInStrings','ON')

$CaseType=WMIQuery('ChassisTypes','Win32_SystemEnclosure')[0]
$SerialNumb=WMIQuery('SerialNumber','Win32_SystemEnclosure')[0]
$Mfg=WMIQuery('Manufacturer','Win32_SystemEnclosure')[0]

SELECT
CASE $CaseType = 1 $SystemType = 'Other'
CASE $CaseType = 2 $SystemType = 'Unknown'
CASE $CaseType = 3 $SystemType = 'Dekstop'
CASE $CaseType = 4 $SystemType = 'Low Profile Desktop'
CASE $CaseType = 5 $SystemType = 'Pizza Box'
CASE $CaseType = 6 $SystemType = 'Mini Tower'
CASE $CaseType = 7 $SystemType = 'Tower'
CASE $CaseType = 8 $SystemType = 'Portable'
CASE $CaseType = 9 $SystemType = 'Laptop'
CASE $CaseType = 10 $SystemType = 'Notebook'
CASE $CaseType = 11 $SystemType = 'Hand Held'
CASE $CaseType = 12 $SystemType = 'Docking Station'
CASE $CaseType = 13 $SystemType = 'All in One'
CASE $CaseType = 14 $SystemType = 'Sub Notebook'
CASE $CaseType = 15 $SystemType = 'Space-Saving'
CASE $CaseType = 16 $SystemType = 'Lunch Box'
CASE $CaseType = 17 $SystemType = 'Main System Chassis'
CASE $CaseType = 18 $SystemType = 'Expansion Chassis'
CASE $CaseType = 19 $SystemType = 'SubChassis'
CASE $CaseType = 20 $SystemType = 'Bus Expansion Chassis'
CASE $CaseType = 21 $SystemType = 'Peripheral Chassis'
CASE $CaseType = 22 $SystemType = 'Storage Chassis'
CASE $CaseType = 23 $SystemType = 'Rack Mount Chassis'
CASE $CaseType = 24 $SystemType = 'Sealed-Case PC'
ENDSELECT

? 'Manufacturer: '+$Mfg
? 'System Type: '+$SystemType
? 'Serial Number: '+$SerialNumb

FUNCTION WMIQuery($sWhat, $sFrom, Optional $sComputer, Optional $sWhere, Optional $x, Optional $root)
Dim $sQuery, $objEnum, $sValue, $sItem, $TMP, $SystemSet, $, $objInstance
If Not $sComputer $sComputer="." EndIf
if instr($sComputer,'\') $sComputer=right($sComputer,instrrev($sComputer,'\')) Endif
if not $root $root="\root\cimv2" Endif
$sQuery = "Select " + $sWhat + " From "+ $sFrom
If $sWhere AND $x $sQuery = $sQuery+" Where "+$sWhere+" = '"+$x+"'" EndIf
$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+$sComputer+$root)
If @ERROR Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf
$objEnum = $SystemSet.ExecQuery($sQuery)
If @ERROR Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf
For Each $objInstance in $objEnum
If $objInstance
$=Execute("$"+"sValue = $"+"objInstance."+$sWhat)
if VarType($sValue) & 8192
For Each $sItem in $sValue $tmp=$tmp+'|'+Trim($sItem) Next
else
$tmp=$tmp+'|'+Trim($svalue)
Endif
EndIf
Next
$WMIQuery = split(substr($tmp,2),'|')
Exit VAL("&"+Right(DecToHex(@ERROR),4))
ENDFUNCTION



[ 23. September 2003, 02:37: Message edited by: NTDOC ]