How to Create SCCM Dynamic Collection Based on Device Type

Want to simplify device targeting in SCCM? This guide shows how to create dynamic collections based on device type—virtual machines, laptops, and desktops—using tested WQL queries. Whether you’re managing hybrid environments or refining deployment scopes, these queries help automate collection membership with precision.

A dynamic or query-based collection reduces the efforts required to manage a deployment as devices are automatically included or excluded in a collection based on query rules.

In this blog post, we’ll explore dynamic collection queries in SCCM for different device types—virtual machines, desktops, and laptops. You’ll find sample WQL queries that have been tested with System Center Configuration Manager (Current Branch, version 2111). These queries can be directly used in your collections to automate membership and achieve precise targeting for deployments.


Related post: If you are looking for a step-by-step process to create a dynamic/query-based collection, then follow this article: How to Create Dynamic Collection in SCCM

Other posts in this series:


SCCM Collection Query for Virtual Machines:

SCCM Collection Query for Virtual Machines (Client & Server OS)

The following WMI Query Language ( WQL ) query will include all virtual machines in a collection.

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 SMS_G_System_COMPUTER_SYSTEM.Model like "%virtual%"

SCCM Collection Query for Virtual Machines (Client OS)

If you want to further limit this only for workstations operating system ( e.g Windows 111 / Windows 10 / Windows 7 etc.), then the below query can be used.

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 SMS_G_System_COMPUTER_SYSTEM.Model like "%virtual%" and SMS_R_System.OperatingSystemNameandVersion like "%Workstation%"

SCCM Dynamic Collection Query for Laptops & Desktops

As seen in the earlier example, the WQL query for selecting virtual machines is relatively straightforward—you can simply filter by the Model property to get the desired results.

However, when it comes to physical devices, the Model field represents the actual hardware model (e.g., Dell Latitude 5420 or Lenovo ThinkPad T490). Because of this variation, a different approach is required to accurately query desktops and laptops.

Win32_SystemEnclsoure Class

The Win32_SystemEnclosure WMI class exposes properties associated with a physical system enclosure. One of the most useful attributes here is the ChassisType, which helps differentiate between desktops, laptops, and other physical form factors.

You can quickly check this information using PowerShell:

Get-WmiObject -Class Win32_SystemEnclosure | Select-Object Caption,ChassisTypes

Chassis Type | Dynamic Collection

The SystemEnclosure information collected from clients is stored on SMS_G_SYSTEM_SYSTEM.ENCLOSURE class in SCCM.

The ChassisTypes field can be used to identify if a device is a desktop, a laptop, or a tablet.

Follow this article to know more about ChassisTypes and their values.

SCCM Collection Query for Laptops

To build a dynamic collection for all laptops, you can filter by ChassisType values in the SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes property. These values correspond to physical form factors, allowing SCCM to accurately identify laptops.

Below is a complete WQL query example that can be used in a collection to automatically include all laptops:

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")

To create a collection for all laptops, we can look for all chassis types for laptops in SMS_G_System_SYSTEM.ENCLOSURE.ChassisTypes. See the complete WQL query below. This query can be used in a collection query to include all desktops in the collection.

SCCM Device Collection Query for Desktops

For creating a collection for all desktops, we can look for all chassis types for laptops in SMS_G_System_SYSTEM.ENCLOSURE.ChassisTypes. See the complete WQL query below. This query can be used in a collection query to include all laptops in the collection.

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 ("3","4","5","6","7","15","16")

SCCM Device Collection Query for Desktops (Without virtual machines)

The Chassis Type value 3 includes a virtual machine as well. If you want to exclude virtual machines from the collection, then the above WQL can be modified to exclude virtual machine. Please see the complete WQL below.

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 inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ("2","3","5","6","7","35","15","4") and SMS_G_System_COMPUTER_SYSTEM.Model not like "%Virtual%"

Conclusion

Dynamic collections in System Center Configuration Manager (SCCM) provide administrators with powerful automation for targeting devices based on type—whether virtual machines, desktops, or laptops. By leveraging WQL queries and properties such as Win32_SystemEnclosure.ChassisType, you can ensure accurate grouping and streamlined deployments. These tested queries not only save time but also improve precision in managing diverse environments. Implementing them in your SCCM collections helps maintain consistency, optimize software distribution, and simplify device management across your organization.

Related Posts:

Subscribe to Techuisitive Newsletter

Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.

Scroll to Top