Posted on 01-29-2018 10:38 AM
We recently installed Cylance and I'm trying to find a script to read the version number to report as an EA.
Posted on 01-29-2018 11:19 AM
Here you go, but like mm2270 points out this really isn't needed since Cylance already grabs it during normal inventory collection.
#!/bin/sh###############################################################
Script is designed to return the 'version number' of Cylance. Verifies the application exists before returning 'version number' or 'not installed'###############################################################
if [ -d /Applications/Cylance/CylanceUI.app ]; then CylanceVersion=/usr/bin/defaults read /Applications/Cylance/CylanceUI.app/Contents/Info.plist CFBundleShortVersionString
echo "<result>$CylanceVersion</result>" else echo "<result>Not found</result>" fi exit 0
Posted on 01-29-2018 11:24 AM
Just curious, but, why the need for an EA if the Cylance app is a regular .app bundle in the Applications folder? Wouldn't it be picked up automatically by Jamf's inventory collection? Typically EAs for a version are only needed if the product isn't really a regular app, or not in a standard location, or is embedded within an XML file or something along those lines.
Posted on 01-29-2018 11:47 AM
Thanks for the response! When it runs it returns "Installed" but not the version number. Is there a tweak I would need to make to return the version number? It seems like it should work. I could be doing something wrong as well.
Posted on 01-29-2018 11:51 AM
That would be the problem, It is in Applications and I believe it should be a regular bundle however, it does not seem to be getting picked up in the collection and I need a way to see the version numbers for updating.
Posted on 01-29-2018 12:12 PM
Well, that's odd, and doesn't make sense.
What happens if you go open the System Information.app and click on Applications under the Software section. Does the Cylance app show up there, with it's version number? If it's there, then generally speaking the recon should also pick it up.
Posted on 01-29-2018 12:24 PM
I can see it when I open a device and click on applications. What I am trying to accomplish (and probably not saying it very well) is to display that information under the list in the general tab so it can be viewed when the inventory display search is done. Basically if I hit search and a list of devices are returned the version of Cylance should be visible or not installed should appear. Right now I can get it to installed or not installed but not the version number.
Posted on 01-29-2018 12:33 PM
Ok, well that's something different. Normally applications and versions won't show up in a standard inventory column view. So the EA is going to be the way tp do that. I'm curious why it's necessary to have it show up there. Maybe you can elaborate on the end goal, and there may be another approach to take. But, if you set up an EA similar to the one above from @eosrebel, it should capture it and then you can add in that item as a column for advanced searches, or just in simple searches.
I'm not sure what you mean by the "installed" or "not installed" though. are you saying the EA is reporting that? Because from what was posted above, it shouldn't just report installed. It should show the version number.
Posted on 01-29-2018 01:08 PM
The installed/not installed was coming from a previous EA setup attempt. Starting brand new the script returns nothing although it looks like it should.
Posted on 01-29-2018 04:27 PM
Nothing as in the field is blank? A recon has been run against the test machine yes?
Posted on 01-30-2018 06:57 AM
I can now see the not found, so the script is working just still not pulling the version. Following your script it leads to where the correct files are located. I cant figure out why it is not pulling the version out of the file.
Posted on 01-30-2018 08:15 AM
@cmcnamara I would suggest trying the script command by itself in Terminal on a system that has this Cylance product installed. Meaning, open Terminal and put in
/usr/bin/defaults read /Applications/Cylance/CylanceUI.app/Contents/Info.plist CFBundleShortVersionString
See what that returns.
Hmm. Now that I'm looking closer, the script above seems to be getting cut off and the forum isn't scrolling to the right for me. I'm wondering if what you copied and pasted was the full correct command or if it's truncated. Might that be the issue?
Posted on 01-31-2018 06:56 AM
I did try that and the script does return the version number in terminal just not in the general search window
Posted on 07-23-2018 11:13 AM
I found that this EA script is causing sudo jamf recon to hang at Gathering Application Usage Information indefinitely. macOS version did not matter.
I manually uninstalled Cylance, killall jamf, sudo jamf recon to get machine inventory.
After I removed this EA, installed Cylance, did inventory collection without issue.
Running Jamf Pro 10.4.1 on Dedicated Hosted server
Claudio