SELECT
DisplayName0,
Count(*) AS ‘Count’,
Publisher0,
@CollID as CollectionID
FROM
v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID
WHERE
fcm.CollectionID = @CollID
AND (
ARP.DisplayName0 not like ‘%hotfix%’
AND ARP.DisplayName0 not like ‘%update%’
AND ARP.DisplayName0 not like ‘%Screen Saver%’
AND ARP.DisplayName0 not like ‘%silverlight%’
AND ARP.DisplayName0 not like ‘%Windows Live%’)
AND (ARP.Publisher0 not like ‘%Intel%’
AND ARP.Publisher0 not like ‘%Hewlet%’
AND ARP.Publisher0 not like ‘%Apple%’
AND ARP.Publisher0 not like ‘%ati%’
AND ARP.Publisher0 not like ‘%eastman%’
AND ARP.Publisher0 not like ‘%google%’)
OR ARP.Publisher0 is NULL
GROUP BY
DisplayName0,
Publisher0
ORDER BY
Publisher0