1

I'm having a problem with this part of a SCCM WQL query looking for "less than version 75.0.3770.80":

... where SMS_G_System_ADD_REMOVE_PROGRAMS.Version < "75.0.3770.80"

If i'm not mistaken this is the good old problem seen before in other scenarios (file names for example) where it will return objects with version number :

75.0.3770.142   

Because in it's logic "of course" .142 is "less than" .80 because .1 is less than .8. It doesn't treat it as "142 versus 80" but "1 versus 8"

Is there any way I can work around this? I'm getting a lot of false positives with this query and need to filter them out. If it was straight Powershell I could cast it as [version] but in SCCM, is it at all possible to do this comparison?

Rakha
  • 1,874
  • 3
  • 26
  • 60

3 Answers3

1

If only the last part of the version number is different, we could use the following one.

... where SMS_G_System_ADD_REMOVE_PROGRAMS.Version like "75.0.3770.[1-7][0-9]"
or ... like "75.0.3770.[0-9]"

Best Regards, Ray

Ray
  • 91
  • 3
  • Ah, good tip with the brackets! However here it's needed to get all versions less than "75.0.3770.80", this wouldn't work – Rakha Aug 14 '19 at 12:09
0

Ended up using SMS_G_System_ADD_REMOVE_PROGRAMS.Version < "75.0.3770"

Rakha
  • 1,874
  • 3
  • 26
  • 60
0

This goes wrongs if the first version nr reach 100. Better something like this

SMS_G_System_ADD_REMOVE_PROGRAMS.Version like "75.0.%" and
SMS_G_System_ADD_REMOVE_PROGRAMS.Version < "75.0.3770