> Does anyone know of a WMI setting that provides info as to whether a laptop
> is docked or not?
Hi
You might be so lucky that the computers return 12 (Docking Station) as an
value for the ChassisTypes property in the Win32_SystemEnclosure WMI class when
docked:
An extract from a previous post by me
(http://groups.google.com/groups?selm=3D57F055.56BF53EB%40hydro.com):
sComputer = "." ' use "." for local computer
sChassisTypeExact = GetChassisExact(sComputer)
WScript.Echo sChassisTypeExact
Function GetChassisExact(sNode)
Set oShell = CreateObject("WScript.Shell")
Set oEnclosureSet = GetObject("winmgmts://" & sNode & "/root/CIMV2")._
InstancesOf ("Win32_SystemEnclosure")
For Each oEnclosure In oEnclosureSet
If oEnclosure.ChassisTypes(0) <> "" Then
iChassis = oEnclosure.ChassisTypes(0)
End If
Next
Select Case iChassis
Case "1" sDesc = "Other"
Case "2" sDesc = "Unknown"
Case "3" sDesc = "Desktop"
Case "4" sDesc = "Low Profile Desktop"
Case "5" sDesc = "Pizza Box"
Case "6" sDesc = "Mini Tower"
Case "7" sDesc = "Tower"
Case "8" sDesc = "Portable"
Case "9" sDesc = "Laptop"
Case "10" sDesc = "Notebook"
Case "11" sDesc = "Hand Held"
Case "12" sDesc = "Docking Station"
Case "13" sDesc = "All in One"
Case "14" sDesc = "Sub Notebook"
Case "15" sDesc = "Space-Saving"
Case "16" sDesc = "Lunch Box"
Case "17" sDesc = "Main System Chassis"
Case "18" sDesc = "Expansion Chassis"
Case "19" sDesc = "SubChassis"
Case "20" sDesc = "Bus Expansion Chassis"
Case "21" sDesc = "Peripheral Chassis"
Case "22" sDesc = "Storage Chassis"
Case "23" sDesc = "Rack Mount Chassis"
Case "24" sDesc = "Sealed-Case PC"
Case Else sDesc = "No Description"
End Select
GetChassisExact = sDesc
End Function
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3F58A68...@hydro.com...