SCCM Collection Query – Virtual Machines

Building a Configuration Manager collection that contains only virtual machines is useful for scoping patch schedules, maintenance windows, or software deployments differently between your physical and virtual estate. The Model/Manufacturer-Based Approach The most reliable way to build this collection today is still matching on the hardware inventory Model and Manufacturer fields rather than any single […]

SCCM Collection Query Virtual Machines
Building a Configuration Manager collection that contains only virtual machines is useful for scoping patch schedules, maintenance windows, or software deployments differently between your physical and virtual estate.

The Model/Manufacturer-Based Approach

The most reliable way to build this collection today is still matching on the hardware inventory Model and Manufacturer fields rather than any single dedicated “is this a VM” flag:
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 in ("Virtual Machine", "VMware Virtual Platform", "VirtualBox")

Older/Fallback Approach

If some clients aren’t reporting a clean Model string, you can catch most hypervisors by matching on the Manufacturer field instead (VMware, Microsoft Corporation for Hyper-V, or Xen), though this is less precise and worth spot-checking against known VMs in your environment before relying on it. As with any hardware inventory query, results depend on hardware inventory having actually run recently on each client — a machine that hasn’t reported inventory in a while may be missing from the collection even if it’s genuinely virtual.

What About a Dedicated “Is Virtual Machine” Flag? (Updated for 2026)

Configuration Manager’s database does technically expose an Is_Virtual_Machine boolean column in v_R_System, sourced from the client’s own CCM_DesktopMachine.IsVirtual WMI property, so it’s tempting to build a collection query straight off that single field instead of matching Model/Manufacturer strings. In practice that’s not the recommended approach: the flag has long-documented reliability gaps, most notably missing VMware ESXi-hosted virtual machines in some environments, which means a collection built purely on Is_Virtual_Machine can silently under-report your virtual estate. The Model/Manufacturer WQL query above remains the more dependable, commonly recommended method for exactly this reason — treat any dedicated VM flag as a secondary cross-check rather than your primary source, and spot-check both against a handful of machines you know for certain are virtual.

Resources

🛠️

Gear We Recommend

Running this in a home lab? Here’s the gear that keeps our test environment reliable.

Browse our Home Lab Essentials picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.

2 thoughts on “SCCM Collection Query – Virtual Machines

  1. The query actually gets all non-VM machines. I changed it to be as follows,
    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 where SMS_R_System.ResourceId in (select SMS_R_SYSTEM.ResourceID 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%”)

  2. The query actually gets all non-VM machines. I changed it to be as follows,
    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 where SMS_R_System.ResourceId in (select SMS_R_SYSTEM.ResourceID 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%”)

Comments are closed.