Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / SCCM / SCCM and WMI Query to Find All Laptops and Desktops

July 26, 2021 SCCM

SCCM and WMI Query to Find All Laptops and Desktops

To install special software on all portable devices of the company it was necessary to build an SCCM collection, which would include all laptops (an other portable mobile systems) in a corporate network. At once I could not find the system property to explicitly identify a computer as a laptop or a desktop.

To begin with, I tried to filter portable devices using WMI filters of GPO and install software to them using group policies. There were several variants to create WMI queries by means of checking:

  • Battery status (only laptops have it): SELECT * FROM Win32_Battery WHERE (BatteryStatus <> 0)
  • RAM type (SODIMM for laptops): Select * from Win32_PhysicalMemory WHERE (FormFactor = 12)
  • PCSystemType properties: SELECT * FROM Win32_ComputerSystem WHERE PCSystemType = 2
Note. Possible PCSystemType values

ValueSystem Type
0Unspecified
1Desktop
2Mobile
3Workstation
4Enterprise Server
5Small Office and Home Office (SOHO) Server
6Appliance PC
7Performance Server
8Maximum

Each of these queries has its advantages and disadvantages. In theory, the most optimal one should be the filtration by PCSystemType value, but this class appeared only in Vista, and we have many computers running the obsolete Windows XP, which won’t be filtered using this queries.

A WMI queries to determine ChassisTypes, being a part of Win32_SystemEnclosure class has seemed more interesting:

WMI-Explorer ChassisTypes

The possible values of ChassisTypes are given in the table below.

ChassisTypes ValueSystem Type
1Other
2Unknown
3Desktop (including virtual machines)
4Low Profile Desktop
5Pizza Box
6Mini Tower
7Tower
8Portable
9Laptop
10Notebook
11Hand Held
12Docking Station
13All in One
14Sub Notebook
15Space-Saving
16Lunch Box
17Main System Chassis
18Expansion Chassis
19Sub Chassis
20Bus Expansion Chassis
21Peripheral Chassis
22Storage Chassis
23Rack Mount Chassis
24Sealed-Case PC

Thus, the following Chassis Types are typical to:

  • laptops: 8 , 9, 10, 11, 12, 14, 18, 21
  • desktops: 3, 4, 5, 6, 7, 15, 16
  • servers: 17,23

The final version of a WMI filter looks like this:

select * from Win32_SystemEnclosure where ChassisTypes = "8" or ChassisTypes = "9" or ChassisTypes = "10" or ChassisTypes = "11" or ChassisTypes = "12" or ChassisTypes = "14" or ChassisTypes = "18" or ChassisTypes = "21"

This WMI filter can be easily transformed into an SCCM query, which allows to build a collection with all laptops in the network.

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where
SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( "8", "9", "10","11", "12", "14","18","21")

sccm query to find laptops

Finally, to provide a comprehensive view about the quantitative ratio of desktops and laptops in the network, you can make an SCCM report:

SELECT
CASE ChassisTypes0
WHEN '8' THEN 'Notebooks'
WHEN '9' THEN 'Notebooks'
WHEN '10' THEN 'Notebooks'
WHEN '11' THEN 'Notebooks'
WHEN '12' THEN 'Notebooks'
WHEN '14' THEN 'Notebooks'
WHEN '18' THEN 'Notebooks'
ELSE 'Desktops'
END AS "Workstation Type", count(distinct sys.name0) as ClientCount from
v_GS_SYSTEM_ENCLOSURE ENC
INNER JOIN
v_R_System SYS ON ENC.ResourceID = SYS.ResourceID
WHERE
sys.client0=1 AND sys.obsolete0=0 AND active0=1
GROUP BY
CASE ChassisTypes0
WHEN '8' THEN 'Notebooks'
WHEN '9' THEN 'Notebooks'
WHEN '10' THEN 'Notebooks'
WHEN '11' THEN 'Notebooks'
WHEN '12' THEN 'Notebooks'
WHEN '14' THEN 'Notebooks'
WHEN '18' THEN 'Notebooks'
ELSE 'Desktops'
END
ORDER BY 2 desc

In our case, the proportion of desktop PCs and laptops is 2832 to 109.

sccm report with laptops / desktops countSo, we have considered how to create an SCCM collection or a GPO WMI filter that allows to select all laptops in the network using ChassisTypes attribute of SystemEnclosure class.

6 comments
0
Facebook Twitter Google + Pinterest
previous post
Printer Pooling: How to Configure a Printer Pool in Windows Server 2012 R2
next post
Windows: Auto Reconnect to VPN on Disconnect

Related Reading

How to Completely Uninstall Previous Versions of Office...

April 26, 2022

Upgrading Windows 10 Build with Setup.exe Command-Line Switches

May 28, 2020

Configuring Remote Control in SCCM 2012

May 6, 2016

6 comments

Peter Huiskens December 11, 2019 - 8:55 am

If you have any surface devices in your organization, do not use the memory selection. only use chassis form factor.

Memory form factor of so-dim is incorrectly returned on surface devices, and therefor seen as desktop memory.

Reply
Ben February 28, 2020 - 3:30 am

gpresult using that wmi filter shows denied for a surface with chassis type 9, which is included. in your query. I saw another article that says you can’t use a chassis type array in WMI filter?

Reply
Ben February 28, 2020 - 3:31 am

I haven’t been able to get this to work. All the notebooks and tablets are getting denied by the WMI filter. Many thanks for any help.

Reply
Peter Huiskens February 28, 2020 - 8:40 am

in the end i haven’t set that one up,
i do use the wmi filter for a gpo , i’ll post that in a minute, that one filters out all mobile devices vs desktops.
we use it for filesync ( homedrive sync on or of…)
for now what i use to identify the surface models in sccm:
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId WHERE Model LIKE “%Surface%”

Reply
Peter Huiskens February 28, 2020 - 8:46 am

the gpo wmi filter we use is:
root\CIMv2
Select PCSystemType from Win32_ComputerSystem WHERE (PCSystemType=2)

that seems to work quite well

Reply
Framelite December 8, 2020 - 8:33 pm

According to the SMBIOS System Reference Specifications version 3.4.0 dated 2020-07-17, there are some new ChassisType values. It now goes all the way from 1 to 36 (byte value 01h to 24h). It’s pretty easy to find the full specification in .pdf format online and what you’re looking for in it is Table 17 (System Enclosure or Chassis Types).

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Configuring Remote Control in SCCM 2012
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top