Skip to main content
Solved

Java Version Smart group

  • June 13, 2017
  • 6 replies
  • 29 views

Forum|alt.badge.img+3

I'm trying to get a smart computer group running to check for Java/java version. I can't seem to get it working. I use the script below in an Extension Attribute and have the group set for "is not" Java 8 Update 131 build 11

Any ideas?

#!/bin/sh
version=`defaults read /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info CFBundleShortVersionString`

echo "$version"

Best answer by Chuey

When viewing the computer record and looking at your Java Version Extension Attribute, is it reporting the "Java 8 Update 131 build 11"?

I just noticed you don't have:

echo "<result>$version</result>"

From my understanding <result> tags are necessary for it populate the EA.

6 replies

Forum|alt.badge.img+10
  • Valued Contributor
  • 234 replies
  • Answer
  • June 13, 2017

When viewing the computer record and looking at your Java Version Extension Attribute, is it reporting the "Java 8 Update 131 build 11"?

I just noticed you don't have:

echo "<result>$version</result>"

From my understanding <result> tags are necessary for it populate the EA.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 7 replies
  • June 13, 2017

i removed the result tags for testing, I'll put them back in and then see what i get in the Inventory field, which i didn't know was there :). Thanks


Forum|alt.badge.img+12
  • Contributor
  • 64 replies
  • June 13, 2017

And perhaps use CFBundleVersion instead of CFBundleShortVersionString which will give you 1.8.131.11 instead of Java 8 Update 131 build 11.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 7 replies
  • June 13, 2017

There we go, your pointing me to the EA tab in inventory greatly sped up me resolving the issue. for future reference the script below did it (all along i had single quotes around the <result> tags, that was the issue). Smart Computer Groups criteria using the EA operator is not value Java 8 Update 131 build 11

#!/bin/sh
version=`defaults read /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info CFBundleShortVersionString`
echo "<result>$version</result>"

Forum|alt.badge.img+10
  • Valued Contributor
  • 234 replies
  • June 13, 2017

@brandonalexander Glad you got it working!


shrisivakumaran
Forum|alt.badge.img+8