SQL Query: Devices Discovered by Configuration Manager in the Last 24 Hours
If you want to keep an eye on new devices as they get discovered by Configuration Manager — useful for spotting unexpected or unauthorised devices appearing on your network early — this SQL query lists everything discovered within the last day:SELECT SMS_R_System.Name, SMS_R_System.CreationDate
FROM SMS_R_System
WHERE DateDiff(dd, SMS_R_System.CreationDate, GetDate()) <= 1
To look further back than 24 hours, change the 1 at the end to however many days you want to check — for example <= 7 for the last week. Build this as a saved query or an SSRS report if you want to check it regularly, and consider scheduling it to run daily and alert you (via an SSRS subscription, for example) rather than remembering to check it manually.
Bear in mind this reflects when Configuration Manager’s discovery methods first created the resource record, which depends on your discovery method schedules (Active Directory System Discovery, Heartbeat Discovery, and so on) — a device that exists on your network but hasn’t yet been picked up by a discovery cycle won’t show here until it has been.
Still Current on Configuration Manager 2603 (Updated for 2026)
This query is unchanged on the current release of Configuration Manager (2603, generally available 27 May 2026) —SMS_R_System.CreationDate and the underlying discovery-record behaviour work exactly as described above on the current version. A couple of practical notes worth adding: pair this with SMS_R_System.Client in your SELECT to see at a glance whether a newly-discovered device has actually had the Configuration Manager client installed yet, since discovery and client installation are separate processes and a device can sit “discovered but clientless” for a while. If you’re using this for security monitoring specifically, also cross-reference results against your network access control / DHCP lease logs — Configuration Manager discovery only tells you what your existing discovery methods found, not every device that touched the network.
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.
@SCCMF12TWICE https://t.co/uSpRzXOkk9
Awesome, works great. I needed this to track techs not using the most current image we recently created. Thanks,
Awesome, works great. I needed this to track techs not using the most current image we recently created. Thanks,
Awesome, works great. I needed this to track techs not using the most current image we recently created. Thanks,
Try this:
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
Try this:
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
Try this:
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
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 DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 1
I get a syntax error when I try to use this.
I get a syntax error when I try to use this.
I get a syntax error when I try to use this.