SCCM WQL Query: Machines with a Valid Hardware Scan in X Days

If you want to identify which Configuration Manager clients have had a valid hardware inventory scan within the last x number of days, this WQL query does the job. The Query select SMS_R_System.Name, SMS_G_System_WORKSTATION_STATUS.LastHardwareScan from SMS_R_System inner join SMS_G_System_WORKSTATION_STATUS on SMS_G_System_WORKSTATION_STATUS.ResourceId = SMS_R_System.ResourceId where DateDiff(dd,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,GetDate()) <= 7 Change the 7 at the end to whatever […]

SCCM Wql Query For Machines With A Valid Hardware Scan In The Last X
If you want to identify which Configuration Manager clients have had a valid hardware inventory scan within the last x number of days, this WQL query does the job.

The Query

select SMS_R_System.Name, SMS_G_System_WORKSTATION_STATUS.LastHardwareScan from SMS_R_System inner join SMS_G_System_WORKSTATION_STATUS on SMS_G_System_WORKSTATION_STATUS.ResourceId = SMS_R_System.ResourceId where DateDiff(dd,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,GetDate()) <= 7
Change the 7 at the end to whatever window (in days) you want to check — for example, 1 for scans in the last 24 hours, or 30 for the last month.

Using It

Paste this into a new Query or a Collection’s Query Rule (Query Language tab) in the ConfigMgr console the same way as any other WQL-based rule. Because it’s filtering on LastHardwareScan, results depend entirely on hardware inventory actually being enabled and running on the client — a genuinely healthy client with hardware inventory disabled at the client settings level will never show up here, so this is best used alongside (not instead of) a general client health check.

Still Current on Configuration Manager 2603 (Updated for 2026)

Checked against Microsoft’s own current class reference: SMS_G_System_WORKSTATION_STATUS and its LastHardwareScan property remain documented with no deprecation notice, and the query pattern above (joining it to SMS_R_System on ResourceId) is still the standard idiom used across current community query collections. Microsoft’s reference page for this class doesn’t carry an explicit “confirmed unchanged in 2603” statement, so it’s worth a quick test run in your own console before scripting it into a scheduled report, but there’s no indication this class has been renamed or replaced.

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.