SCCM collection based on Heartbeat Agent older than X days

In my previous post,we saw how to create SCCM report to list clients with its heartbeat time stamp . In this post ,we are going to see ,how to create Create a collection to list clients that are not sending or not reported to SCCM since X days based on its heartbeat (DDR) agent time.

To get clients that are not sending heartbeat DDR ,we will use sub selected query which means ,we first create collection that list all clients have heartbeat DDR < 23 days and use this in subselected query to list clients that are not in first created query. Entire query can be put into one collection which is given below.

Create a collection ,choose new query based and paste the following query init.

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 not in (select ResourceID from SMS_R_System where AgentName in ("Heartbeat Discovery") and DATEDIFF(day,AgentTime,GetDate())<23)

You can replace the number of days and agent name as you need in the above query.

4 Responses to "SCCM collection based on Heartbeat Agent older than X days"

  1. This query takes all Agent Times into consideration, not just Heartbeat Discovery, how to just filter by Heartbeat Discovery Agent Time?

    1. i just tried the query ,it takes only the heartbeat discovery time. can you post the results what you see that tell all agent time?



Leave a Reply to Eswar Koneti Cancel reply