SCCM Device Collection Based on Exchange Server Role

Following on from other Configuration Manager collection query guides, here’s one for building a device collection of everything running the Microsoft Exchange Server role. The Query 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_SERVICE on SMS_G_System_SERVICE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SERVICE.Name like "MSExchange%" Using It Create a new Device Collection under Assets […]

SCCM Create A Device Collection Based On Exchange Server Role
Following on from other Configuration Manager collection query guides, here’s one for building a device collection of everything running the Microsoft Exchange Server role.

The Query

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_SERVICE on SMS_G_System_SERVICE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SERVICE.Name like "MSExchange%"

Using It

  1. Create a new Device Collection under Assets and Compliance > Device Collections.
  2. Add a Query Rule membership rule, switch to the Query Language tab, and paste the query above.
  3. Save and let the collection populate on its next refresh cycle.
This works by matching on Exchange-related Windows services reported through hardware inventory, so it depends on the Services inventory class being enabled in your client settings and the Exchange server having reported inventory recently. It’ll generally catch Mailbox, Client Access/Front End, and Transport roles, since all three register MSExchange-prefixed services.

A Note on What You’ll Actually Catch Today

Exchange Server 2019 was the last traditionally-versioned on-premises release — Microsoft skipped straight from there to Exchange Server Subscription Edition (SE), which reached general availability in July 2025 and now receives regular cumulative/security updates on an ongoing subscription-style servicing model rather than a numbered version cycle. Exchange 2016 and 2019 both reached end of support in October 2025, which means SE is now the only supported on-premises option — any collection built from this query today should realistically be turning up SE servers (upgraded in-place from 2019) rather than 2016/2019 boxes still on the old, now-unsupported versions. It’s also worth remembering this collection only ever sees on-premises Exchange servers reporting into your ConfigMgr hierarchy — it has no visibility into Exchange Online at all, since hybrid or cloud-only mailboxes aren’t ConfigMgr-managed devices. If you’re auditing a hybrid environment, use this collection for the on-prem estate and pair it with Exchange Online’s own admin reporting (or Get-ExchangeServer / the Hybrid Configuration wizard’s health checks) for the cloud side, rather than expecting one query to cover both.

Resources

🛠️

Gear We Recommend

Testing configs is easier with a dedicated admin machine set up right. Here’s the kit we use.

Browse our Windows Admin Toolkit 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 Device Collection Based on Exchange Server Role

  1. Did something change? How does this query works, since the SMS_G_System_SERVICE.Name looks for the Service Name (MSExchange%) not the Display Name (at least in CM1809)?

  2. Did something change? How does this query works, since the SMS_G_System_SERVICE.Name looks for the Service Name (MSExchange%) not the Display Name (at least in CM1809)?

Comments are closed.