I'm a little surprised this doesn't come out of the box and I can't find it on Google either but I'm looking for a SQL query that will return each machine and it's patch status. For example:
Name Updates Advertised Updates Applied
PC1 250 123
Server1 120 65
Server2 120 78
PC2 210 154
So it would look at each individual update advertised to that machine, regardless of what advertisement it's in, and return a total and how many are completed. Sounds nice and simple...
I tried this but I'm getting mostly failures reported. I know all the updates haven't failed so something's still not right...
SELECT d.Netbios_Name0 ,count(CI_ID) Updates --,CI_ID ,us.StateID ,StateName FROM [v_UpdateState_Combined] us join V_Statenames sn on us.StateID = sn.StateID and us.StateType = sn.TopicType join v_R_System_Valid d on d.ResourceID = us.ResourceID where us.StateType = 402 group by Netbios_Name0, us.StateID, StateName order by Netbios_Name0Any SCCM DB experts around maybe?