Tuesday, January 04, 2011

SCCM Collection based on 'File' and version less than "X"

The below System query shows "X.exe" file with anything less than version "X.x.x.x.". Very useful for discovering out of date files and creating and advertisement to install the correct version

Make sure you have your file inventory configured correctly.


SELECT        VRS.ResourceID, VRS.ResourceType, VRS.Name0

FROM            dbo.v_R_System AS VRS INNER JOIN
                         dbo.v_GS_SoftwareFile AS SF ON VRS.ResourceID = SF.ResourceID

 WHERE        SF.FileName = 'X.exe' AND SF.FileVersion <= 'x.x.x.x'
Please note i've used 'less than or equal to' in the above query if you want just less than remove the '='

Also a different way to do the same. Create 2 queries

http://www.sccm-tools.com/tools/wqlqueries/WQLQueries-Colcompswithfile.html

2 comments :

  1. Your query doesn't show version less than x - you have file = "x.x.x.xx.x" so it will only return the exact version specified.

    ReplyDelete
  2. You're right. I've now updated the query. Thank you for commenting.

    ReplyDelete