Posted on 02-28-2020 09:08 AM
Alright so I'm trying to create an Extension Attribute to get the version of Cisco AnyConnect on the machines. But I'm getting blank results, I setup Skype the same way and it seems to work fine. Does something look wrong?
Data Type: String
Inventory Display: Extension Attributes
Input Type: Script
if [ -f "/Applications/Cisco/Cisco AnyConnect Secure Mobility Client.app/Contents/info.plist" ] ; then
VERSION=$( defaults read "/Applications/Cisco/Cisco AnyConnect Secure Mobility Client.app/Contents/info.plist" CFBundleShortVersionString )
else
VERSION="Not installed"
fi
echo "<result>$VERSION</result>"
Solved! Go to Solution.
Posted on 02-28-2020 01:30 PM
OK, I see. You may not be aware of this, but there is one possible way to do this without needing an Extension Attribute.
If you do a standard computer Advanced Search and use the criteria of "Application Title" is or has "Cisco AnyConnect Secure Mobility Client.app", once you run the search, you can then begin to export the results.
On the screen where it asks you "Choose the inventory item on which to base your results", you can choose "Applications" instead of the default "Computers" option.
When the export completes, what this gives you is a csv file that will have the computer results sorted in a way that all devices that have specific versions of the app installed get grouped together. It still shows each machine, but there will be a main column with the app and application version that they are under, so to speak. You kind of have to see it to understand what I mean.
This may or may not give you what you want. Some people don't like the way those exports come out. They can sometimes be a little difficult to use in external tools, but it's worth at least looking at it to see if it's an option for you.
Posted on 02-28-2020 09:20 AM
You are missing the # in the first line.
Unless you just missed it in your copy
Posted on 02-28-2020 09:20 AM
Out of curiosity, why would such an Extension Attribute be needed? I have Cisco AnyConnect Secure Mobility Client installed on my Mac, and the version is captured natively by the jamf binary.
Posted on 02-28-2020 11:02 AM
I missed the # in my paste here
Posted on 02-28-2020 01:16 PM
mm2270, I'm trying to get it to display in an Inventory report so I can export all the versions to a spreadsheet
Posted on 02-28-2020 01:30 PM
OK, I see. You may not be aware of this, but there is one possible way to do this without needing an Extension Attribute.
If you do a standard computer Advanced Search and use the criteria of "Application Title" is or has "Cisco AnyConnect Secure Mobility Client.app", once you run the search, you can then begin to export the results.
On the screen where it asks you "Choose the inventory item on which to base your results", you can choose "Applications" instead of the default "Computers" option.
When the export completes, what this gives you is a csv file that will have the computer results sorted in a way that all devices that have specific versions of the app installed get grouped together. It still shows each machine, but there will be a main column with the app and application version that they are under, so to speak. You kind of have to see it to understand what I mean.
This may or may not give you what you want. Some people don't like the way those exports come out. They can sometimes be a little difficult to use in external tools, but it's worth at least looking at it to see if it's an option for you.
Posted on 02-28-2020 03:33 PM
@ChadL3 : when pasting code into Jamf Nation, you need to put three backticks before the first line and after the last line of code.
Example:
```
#!/bin/bash
Line 1
Line 2
Line 3
```
Becomes:
#!/bin/bash
Line 1
Line 2
Line 3
Posted on 05-25-2021 09:18 AM
Here's another way of getting AnyConnect version, grabbing it from vpn stats output.
#!/bin/bash
anyConnectVersion=$(/opt/cisco/anyconnect/bin/vpn stats | grep "Cisco AnyConnect Secure Mobility Client" | awk -F"[()]" '{print $2}')
if [[ "$anyConnectVersion" != "" ]]; then
echo "<result>$anyConnectVersion</result>"
else
echo "<result>Not installed</result>"
fi