SCCM Collection Query for Virtual Machines

Configuration Manager Collection Query for Virtual Machines This WQL query builds a Configuration Manager collection containing only virtual machines — useful for scoping maintenance windows, patching schedules, or software deployments differently between your physical and virtual estate, since VMs often have different patching cadences or reboot tolerances than physical hardware. select SMS_R_SYSTEM.ResourceId, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, […]

SCCM Collection Query For Virtual Machines

Configuration Manager Collection Query for Virtual Machines

This WQL query builds a Configuration Manager collection containing only virtual machines — useful for scoping maintenance windows, patching schedules, or software deployments differently between your physical and virtual estate, since VMs often have different patching cadences or reboot tolerances than physical hardware.
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 ("VMware Virtual Platform", "Virtual Machine", "VirtualBox")
The Model values in the where clause correspond to the common hypervisor signatures reported by VMware, Hyper-V, and VirtualBox respectively — if you run a different hypervisor, check what your own VMs report for Model in hardware inventory (v_GS_COMPUTER_SYSTEM) first and add that value to the list, since not every hypervisor reports the same string.

Common Model Strings by Hypervisor

Since guessing the exact string is unreliable, here are the values most commonly seen for the major platforms — worth adding to the in (...) list above if you run a mixed estate:
Hyper-V:      Virtual Machine
VMware:       VMware Virtual Platform, VMware7,1 (and other "VMwareNN,N" variants)
VirtualBox:   VirtualBox
Nutanix AHV:  AHV
KVM/QEMU:     Standard PC (Q35 + ICH9, 2009), Standard PC (i440FX + PIIX, 1996)
Xen:          HVM domU
Newer VMware ESXi hosts have started reporting numbered platform strings that include the VM’s hardware version (e.g. VMware7,1) instead of the classic VMware Virtual Platform string, and the exact number changes as newer hardware versions ship — so a query built purely against the old value can silently miss VMs on newer hosts. Worth re-checking your own environment’s actual reported Model values periodically (via a quick hardware inventory report) rather than assuming the original list still covers everything.

A More Resilient Alternative: Checking the Manufacturer Field

Rather than matching an ever-growing list of exact Model strings, some admins instead flag anything where Manufacturer isn’t a physical hardware vendor (Dell, HP, Lenovo, and so on), which catches new or unlisted hypervisor signatures automatically at the cost of needing your physical-vendor exclusion list kept current instead. Neither approach is fully maintenance-free — pick whichever list (hypervisors you have, or vendors you have) is shorter and more stable in your environment.

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.