Close Menu
    Facebook X (Twitter) Instagram
    Saturday, October 11
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»Patch Reports»Another Patch statistics report for SCCM 2007

    Another Patch statistics report for SCCM 2007

    Eswar KonetiBy Eswar KonetiMay 16, 2:28 pm1 Min Read Patch Reports 1,062 Views
    Share
    Facebook Twitter LinkedIn Reddit

    Here is another patch statistics report for SCCM 2007 environment with summary of patches that are deployed within month (30 days) with different column.

    select 'Total number of active patches within 30days:', COUNT(distinct Title) AS 'Count'
    FROM v_GS_PatchStatusEx
    WHERE (DATEDIFF(Day, LastStatusTime, GETDATE())) <=30
    UNION
    select 'Percent sucessfully installed', round(100.0*COUNT( case when LastState=107 or LastState=105 then ResourceID else NULL end)/COUNT(ResourceID),1) as 'Procent succesful' 
    FROM v_GS_PatchStatusEx
    WHERE (DATEDIFF(Day, LastStatusTime, GETDATE())) <=30

    select ps.ID, ps.QNumbers, ps.Title,
        round(100.0*COUNT(distinct case when ps.LastState=107 or ps.LastState=105 then ps.ResourceID else NULL end)/COUNT(distinct ps.ResourceID),1) as 'Procent succesful' ,
           COUNT(distinct case when ps.LastState=107 or ps.LastState=105 then ps.ResourceID else NULL end) as 'Distribution Successful',
           COUNT(distinct case when ps.LastState=101 then ps.ResourceID else NULL end) as 'Distribution Failed',
           COUNT(distinct case when ps.LastState not in (107,105,101) then ps.ResourceID else NULL end) as 'Distribution Incomplete',
           COUNT(distinct ps.ResourceID) as 'In Distribution Scope',
    'SMS00001' as 'CollectionID',
    'Microsoft Update' as 'Type',
    inf.InfoPath
    from v_GS_PatchStatusEx ps
    join v_FullCollectionMembership fcm on ps.ResourceID=fcm.ResourceID
    join v_ApplicableUpdatesSummaryEx inf on
      ps.UpdateID=inf.UpdateID
    where fcm.CollectionID= 'SMS00001' and
             inf.Type = 'Microsoft Update'
             
     AND (DATEDIFF(Day, ps.LastStatusTime, GETDATE())) <=30     
    group by ps.ID, ps.QNumbers, ps.Title, inf.InfoPath

    Compliance reports Configmgr 2007 configmgr report Patch compliance status Patch Management Reports Patch Statistics patch statistics report Patch statistics report for SCCM 2007 SCCM 2007 SCCM 2007 Patch complaince Report SCCM 2007 Patch Complaince Status report SCCM Patch reports SCCM Reports software updates report Software updates report SCCM SQL
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Monitoring Endpoint Security Applications with SCCM ConfigMgr SQL

    October 11, 8:48 pm

    Disable windows updates (wufb) on selected devices using Intune

    July 07, 11:04 pm

    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.