Read Cylance version number

cmcnamara
New Contributor

We recently installed Cylance and I'm trying to find a script to read the version number to report as an EA.

13 REPLIES 13

eosrebel
New Contributor III

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

mm2270
Legendary Contributor III

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.

cmcnamara
New Contributor

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.

cmcnamara
New Contributor

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.

mm2270
Legendary Contributor III

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.

cmcnamara
New Contributor

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.

mm2270
Legendary Contributor III

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.

cmcnamara
New Contributor

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.

eosrebel
New Contributor III

Nothing as in the field is blank? A recon has been run against the test machine yes?

cmcnamara
New Contributor

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.

mm2270
Legendary Contributor III

@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?

cmcnamara
New Contributor

I did try that and the script does return the version number in terminal just not in the general search window

chiguchi
New Contributor

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