Posted on 06-13-2017 06:33 AM
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"
Solved! Go to Solution.
Posted on 06-13-2017 06:51 AM
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.
Posted on 06-13-2017 06:51 AM
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.
Posted on 06-13-2017 07:08 AM
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
Posted on 06-13-2017 07:24 AM
And perhaps use CFBundleVersion instead of CFBundleShortVersionString which will give you 1.8.131.11 instead of Java 8 Update 131 build 11.
Posted on 06-13-2017 07:27 AM
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>"
Posted on 06-13-2017 07:49 AM
@brandonalexander Glad you got it working!
Posted on 02-28-2023 10:08 PM
https://github.com/macbudS/Scripts/blob/main/Java_version_EA.sh