SCCM 2007 Query
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 11.0.10.32 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 < "11.0.0.32" and SMS_G_System_SoftwareFile.FileVersion >= "11.0.0.0")
Answers (2)
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.
Hiya.
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!!
Kory.
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. - anonymous_9363 9 years ago
http://www.codeproject.com/Articles/7938/SQL-User-Defined-Function-to-Parse-a-Delimited-Str - anonymous_9363 9 years ago