Getting All Machines Containing a Specific Software Package

So, Let’s say you need to see all machines that contain a specific software package, you can use sccm’s gui, or you can do it in SQL, where you can act on the results:

 
declare @LookupString as nvarchar 
set @LookupString = '%'
 
SELECT     vrs.Name0
FROM       v_r_system AS vrs 
JOIN   v_GS_INSTALLED_SOFTWARE AS VIS ON VIS.resourceid = vrs.resourceid 
JOIN  v_GS_SoftwareFile AS sf ON SF.resourceid = vrs.resourceid                         
WHERE     VIS.productname0 LIKE @LookupString
GROUP BY vrs.Name0

NAME0

LSEU0778
LSTW0631
MACS4268
LSAM9049
LSGR0590

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s