Find computers with no hardware inventory in 30 days
A WQL collection query that returns computers whose last hardware inventory scan is more than 30 days old.
LanguageWQL
What it does to the systemReads only. It changes nothing.
This query builds a device collection of clients that stopped sending hardware inventory. It compares the last scan date with today.
Use it to find broken or offline clients. Old inventory also makes your other collections wrong.
WQL
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_G_System_WORKSTATION_STATUS.ResourceID
from SMS_G_System_WORKSTATION_STATUS
where DateDiff(dd, SMS_G_System_WORKSTATION_STATUS.LastHardwareScan, GetDate()) > 30
)
How to use it
- In the console, open Assets and Compliance, then Device Collections.
- Open the collection properties. On Membership Rules, select Add Rule, then Query Rule.
- Select Edit Query Statement, then Show Query Language. Paste the query.
- Change
30to the number of days you want. - Give the collection a daily full update. The result depends on today's date.
Good to know
- A client that never sent inventory has no scan date. This query does not return it.
- On the computer, check
C:\Windows\CCM\Logs\InventoryAgent.logto see why inventory stopped.
hardware inventory
LastHardwareScan
client health
SMS_G_System_WORKSTATION_STATUS