Sccm Collection/Query Help
Hi,
Hope someone can help me.. :)
I need to deploy flash player 10.0.32.18 (everything is packaged and ready to roll).. I want to build a dynamic collection that will target machines that have any version of flash player that is < 10.0.32.18 ...
The reason, is that we need an ongoing advert for this since older versions of flash were previously included in our RIS images...
I cannot figure out how to do a "<" when it comes to version from either Add/Remove programs or "installed software" tables... I think it is because these are not actually numbers... is there any way to convert this to a number so I can deploy this properly?
I really thought we were doing this in the past by doing a ... Where version0 < 10.0.32.18 ... but apparently not... If i do something like that I only get the version 10s of flash and nothing lowere...
Thanks,
Z
Hope someone can help me.. :)
I need to deploy flash player 10.0.32.18 (everything is packaged and ready to roll).. I want to build a dynamic collection that will target machines that have any version of flash player that is < 10.0.32.18 ...
The reason, is that we need an ongoing advert for this since older versions of flash were previously included in our RIS images...
I cannot figure out how to do a "<" when it comes to version from either Add/Remove programs or "installed software" tables... I think it is because these are not actually numbers... is there any way to convert this to a number so I can deploy this properly?
I really thought we were doing this in the past by doing a ... Where version0 < 10.0.32.18 ... but apparently not... If i do something like that I only get the version 10s of flash and nothing lowere...
Thanks,
Z
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
zshulko
14 years ago
Well .. This is what I have come up with... Really ugly, but seems to do the trick...
BTW.. the "_" was to account for an anomyly in our environment where we had some versions just showing up as "9"
Anyone see any issues with this?
Query Criteria
Installed Software.Product Name Is like "%Flash Player%"
And
(
Installed Software.Product Version Is like "[0-9].%"
Or
Installed Software.Product Version Is like "_"
Or
Installed Software.Product Version Is like "10.0.[0-2]_.%"
Or
Installed Software.Product Version Is like "10.0.3[0-1].%"
)
The whole SQL Query is...
select SMS_G_System_SYSTEM.Name, SMS_G_System_INSTALLED_SOFTWARE.ProductName, SMS_G_System_INSTALLED_SOFTWARE.ProductVersion from SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like "%Flash Player%" and (SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "[0-9].%" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion = "_" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "10.0.[0-2]_.%" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "10.0.3[0-1].%")
BTW.. the "_" was to account for an anomyly in our environment where we had some versions just showing up as "9"
Anyone see any issues with this?
Query Criteria
Installed Software.Product Name Is like "%Flash Player%"
And
(
Installed Software.Product Version Is like "[0-9].%"
Or
Installed Software.Product Version Is like "_"
Or
Installed Software.Product Version Is like "10.0.[0-2]_.%"
Or
Installed Software.Product Version Is like "10.0.3[0-1].%"
)
The whole SQL Query is...
select SMS_G_System_SYSTEM.Name, SMS_G_System_INSTALLED_SOFTWARE.ProductName, SMS_G_System_INSTALLED_SOFTWARE.ProductVersion from SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like "%Flash Player%" and (SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "[0-9].%" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion = "_" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "10.0.[0-2]_.%" or SMS_G_System_INSTALLED_SOFTWARE.ProductVersion like "10.0.3[0-1].%")
Posted by:
anonymous_9363
14 years ago
The problem, as you have discovered, is that version "numbers" aren't numbers but strings so cumbersome OR constructs are probably as good as any. I don't know enough SQL syntax to know but perhaps there's a means to use a regular expression which would make it tidier.
You may want to explore a different route, whereby you query the machine's registry for a different value. HKCR\Installer\Products\<PackedProductCode>\Version contains a hex value which you could use for an equality/less than/greater than comparison.
You may want to explore a different route, whereby you query the machine's registry for a different value. HKCR\Installer\Products\<PackedProductCode>\Version contains a hex value which you could use for an equality/less than/greater than comparison.
Posted by:
Bobo
14 years ago
Posted by:
zshulko
14 years ago
Yeah.. I think it is all based on the first character... Problem is that we have multiple acrobat readers in the environment...
9.0.x.x
8.0.x.x
10.0.22.x
10.0.32.xx
in a case like this, acording to what you are saying we would need something to conver them to something like the following in order to sort them properly... Just as cumbersome...
09.0.xx
08.0.xx
10.0.22.x
10.0.32.xx
9.0.x.x
8.0.x.x
10.0.22.x
10.0.32.xx
in a case like this, acording to what you are saying we would need something to conver them to something like the following in order to sort them properly... Just as cumbersome...
09.0.xx
08.0.xx
10.0.22.x
10.0.32.xx
Posted by:
anonymous_9363
14 years ago
Even if you converted them, the version strings still wouldn't be numbers, making a '<' or '>' comparison pointless. Besides, I'd wager that a) '09' would convert to zero, since that's the leading digit and b) everything from the first decimal point and beyond would be ignored, meaning that 10.0.0.0 would be treated the same as 10.99.99.99.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.