Tag: query

SCCM: Collection Query to Find Machines Discovered via AD System Discovery in the last day without latest SCCM Client

In the final days I have with my current employer, I've been doing some client cleanup. As you may know, Active Directory System Discovery can make a mess out of your SCCM environment if AD isn't kept clean. We have a lot of records in our DB that just don't have the SCCM Client for…
Read more

SCCM: Collection Query to get all machines who haven’t rebooted in X amount of Days

Here's a query that I use to see all machines who haven't rebooted in 7 days. You can change the 7 to however many days you want. 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_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where DATEDIFF(DD, SMS_G_System_OPERATING_SYSTEM.LastBootUpTime, GETDATE()) > 7