Systems Management Question

SCCM 2007 Query

01/27/2015 3766 views

I need to create a collection of machines that have Acrobat reader 11. so that I can patch them.  The query I created used the acrord32.exe and file versions but is not working properly

If I remove the second version it will give me a collection of all machines with a file version less than but some of these machines have version 10 which this patch will not work on.

Any suggestion on how to fix this?

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "ACRORD32.exe" and (SMS_G_System_SoftwareFile.FileVersion < "" and SMS_G_System_SoftwareFile.FileVersion >= "")

6 Comments   [ + ] Show comments


  • why not try for a start > "", that should give your target but not the v10 files. Or you could use the ProductID of the v11 family instead of the exe
  • I am looking to have the collection dynamically update so the idea is (at least what I am thinking anyways) that once the app is patched to the current it will be removed from the collection. I will be able to tell at a glance what is outstanding.
  • Remember that in the SQL/WQL above you're comparing *strings* not *actual version numbers*, so when using comparison operators, the string "" will always be greater or less than anything which isn't "".

    I don't know how to parse strings in SQL/WQL in order that you could separate out the various elements of a string into discrete integers, against which you could compare other integers, or even if that's possible.
  • Thanks for your help. I have never really been able to find much on how to do queries in SCCM. I usually use Google and try and piece things together and see what works. I wish someone would write a good how to on queries and reports for SCCM (for the beginners like me)
  • I Googled...

  • Thanks for the help everyone. It is greatly appreciated. After much googling what I did to tide me over was create a collection of all machines that had the current version of Adobe Reader which at the time was 11.0.10. I then created a second collection with a query that added all workstations that were not in the first collect. Basically by a process of elimination I was able find the machines I was looking for.. I will try the queries below as well as they seem a little cleaner and only require a single collection.

All Answers

I find that it is much easier to use the "Add/Remove Programs" rather than the inventoried executable files.  By the way, in the GUI, this is listed under "Installed Applications".  Also, this information is collected by the Hardware Inventory rather than the Software Inventory just FYI.

In this case, I would create a query that is something like:

inner join 
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId 
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Reader%" and (SMS_G_System_ADD_REMOVE_PROGRAMS.Version like "11%" AND SMS_G_System_ADD_REMOVE_PROGRAMS.Version < "11.0.03")

Modify the last part for whichever version you're working with, but maybe try the query with only the like "11%" part first to make sure the version is displayed as you're expecting it to be since the version numbers can vary in the ways they are presented.  

If you include like "11%" and the less than criteria, you'll avoid returning anything that's not version 11.
Answered 02/23/2015 by: DeQuosaek
Senior Yellow Belt



If you still prefer to use Software Inventory data, have whipped up a query for you.

You can play around with the version number in the query, as well as what you want to see in the output.

Mind you, I only quickly tested this in the Queries (not in collection).


select SMS_R_System.Name, SMS_R_System.ResourceDomainORWorkgroup, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion, SMS_G_System_SoftwareFile.FilePath from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "ACRORD32.exe" and SMS_G_System_SoftwareFile.FilePath like "C:\\PROGRAM FILES%" and SMS_G_System_SoftwareFile.FileVersion < "12.0" and SMS_G_System_SoftwareFile.FileVersion > "11.0"


Good luck!!


Answered 02/24/2015 by: kory
Senior Yellow Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ