Close Menu
    Facebook X (Twitter) Instagram
    Sunday, October 12
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»CM2012»SQL query to get client count with status active obsolete missing for collections in tabular column

    SQL query to get client count with status active obsolete missing for collections in tabular column

    Eswar KonetiBy Eswar KonetiMarch 19, 10:49 pm1 Min Read CM2012 5,574 Views
    Share
    Facebook Twitter LinkedIn Reddit

     

    Quick blog post on how to get client count with active obsolete and missing status for collections in a nice tabular column.

    I used 3 SQL views in this query V_r_system ,v_FullCollectionMembership_valid  and v_Collection with sum and case statements.

    You can use this SQL code in report creation with collection prompt and also create linked reports.

     

    select coll.Name [Collection Name],fcm.CollectionID,count(sys.name0) [Total clients],
    SUM (CASE WHEN sys.Active0 = 1 THEN 1 ELSE 0 END) AS 'Active Clients',
    SUM (CASE WHEN sys.Obsolete0 = 1 THEN 1 ELSE 0 END) AS 'Obsolete Clients',
    SUM(CASE WHEN sys.Client0 is NULL THEN 1 ELSE 0 END) AS 'Client Missing'
    from v_r_system sys
    inner join v_FullCollectionMembership_Valid fcm on fcm.ResourceID=sys.ResourceID
    inner join v_Collection coll on coll.CollectionID=fcm.CollectionID
    where fcm.CollectionID in ('PS1000DE','PS1000DF')
    Group by fcm.CollectionID,coll.Name

    SQL output:

    image

    For more information about SCCM client health dashboard ,refer https://gallery.technet.microsoft.com/SCCM-Configmgr-2012-SSRS-2863c240

    active collections with client status count clients missing obsolete Reporting SCCM SQL SQL reporting
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Optimize Your Intune Workflow with a Powerful Browser Extension

    March 22, 10:39 am

    Migrate Microsoft 365 Updates from SCCM/MECM to Intune for Co-Managed Devices

    February 11, 9:50 pm

    3 Comments

    1. Hackmuss on March 20, 2018 3:57 PM

      Thanks Eswar- that could be a useful one. Just one small thing - you have a 'c' missing from the 'Obsolete Clients' column title.

      Reply
      • Eswar Koneti on March 24, 2018 4:14 PM

        updated the query but not the screenshot 🙂

        Regards,
        Eswar

        Reply
    2. ramg1967 on March 19, 2018 11:38 PM

      Hi - Can in handy when, I was about to run a report to get missing clients before Windows 10 in place upgrade. Thanks for sharing the query.

      Reply

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.