Create a custom attribute for Citrix Files

jgor415
New Contributor

Hi Everyone,

I am looking to create a custom attribute to display "Citrix Files" version and was able to get the version by typing the following command:

"mdls -name kMDItemVersion /Applications/'Citrix Files.app'"

Any good documentation on how to display this to a custom attribute?

My end goal is to create a smart group to show which computers has older versions of "citrix files"

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor II

You can create Smart Groups from application versions natively in the Jamf Pro UI. Use criteria Application Title and Application Version. The latter criteria lets you use a regex pattern instead of anything absolute, which should give you the ability to look for versions below a certain number. For example, say you wanted to capture any Macs with a Citrix Files version below 20.x, something like this may work. It kind of depends on the versioning scheme for Citrix Files, which I don't use myself, so I don't know how it's versioned.

1[0-9].[0-9]

That would capture anything starting with a 1 and followed by any number between 0 and 9, and then any other number following the period. The regex might have to be modified a little depending on things.

I would at least give that a try first.

View solution in original post

7 REPLIES 7

jgor415
New Contributor

I created this:

#!/bin/sh
ver=`mdls -name kMDItemVersion /Applications/'Citrix Files.app' | awk '{print $3}'`

if [ $ver == "0" ]; then
   echo "<result>No Citrix Files</result>"
else
   echo "<result>$ver</result>"
fi

jgor415
New Contributor

It works however it displays as "20.7" and not 20.7 so maybe I could find a way to remove the quotes.

mm2270
Legendary Contributor II

Hi there. First question from me is, why would this need to be added as an Extension Attribute? If the app is located in the standard /Applications/ path, then the jamf binary should be picking up the version information and reporting that along with all the other apps there.

If it needs to be reported as an EA for some other purpose outside of the normal application reporting, then that's fine. I just want to be sure you knew that the version should be getting captured automatically.

If there's a valid reason for it to be an EA that I'm just not aware of, the EA you have is basically how you would do it. If you want to remove the quotes, simply throw in the -raw flag in your mdls query, like so

mdls -raw -name kMDItemVersion "/Applications/Citrix Files.app"
This allows you to remove the awk bit.
You could also change to double quotes around the entire program path as I have it, though it's fine either way.

jgor415
New Contributor

i removed the quotes by doing this

#!/bin/sh
mdls -name kMDItemVersion /Applications/'Citrix Files.app' | awk '{print $3}' | tr -d "

jgor415
New Contributor

@mm2270 The end goal is I wanted to find out who has a older version of "citrix files" by creating a smart group. Do you have another alternative that might be quicker

mm2270
Legendary Contributor II

You can create Smart Groups from application versions natively in the Jamf Pro UI. Use criteria Application Title and Application Version. The latter criteria lets you use a regex pattern instead of anything absolute, which should give you the ability to look for versions below a certain number. For example, say you wanted to capture any Macs with a Citrix Files version below 20.x, something like this may work. It kind of depends on the versioning scheme for Citrix Files, which I don't use myself, so I don't know how it's versioned.

1[0-9].[0-9]

That would capture anything starting with a 1 and followed by any number between 0 and 9, and then any other number following the period. The regex might have to be modified a little depending on things.

I would at least give that a try first.

View solution in original post

jgor415
New Contributor

Thank you! I knew I was making it more complicated.