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.
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 AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.