Is there a way to track which software has been installed via self-service per computer?

New Contributor III

Helpdesk wants a report on how often self-service is actually used to install applications on a per computer basis - I don't think this is something that is tracked, but I thought I'd ask here to see if anyone else has solved this.


Contributor III

We track usage with a EA but not what get installed (as you can just check the policy logs in each computers History - Policy Logs to see what they installed if you need to dig deeper)

The EA just displays a count to how many times its accessed as a reporting stat, so we can treat this as a potential support request that was answered by Self Service and didn't need a ticket raised with the Service Desk.

Example of the EA below (I can't remember where I got it from so I can't credit. the original author):


Check if app is installed

if [ -z "$APP" ]; then echo "<result>N/A</result>"

Get use count

USECOUNT=$(mdls -name kMDItemUseCount "$APP" | awk '{ print $3 }')

if [[ "$USECOUNT" == "null" ]]; then echo "<result>UNUSED</result>" else echo "<result>${USECOUNT}</result>" fi

New Contributor III

Yeah that might be useful info for now - until then I guess I'll let them know there's no such feature.

Thank you!

Legendary Contributor III

This isn't going to help you retroactively, but one possible way to track which software is installed via Self Service is to add a line in the execute command section, or possibly a full script if needed, to the end of the policy that writes some data into a local log on the machine. What policy got run, what packages it included, that sort of thing. Then have an EA that picks up those entries on each recon. Going forward, you would be able to see which Self Service policies were run on each Mac by looking at that EA entry.
As I said, this won't help with anything that was previously installed. There isn't really a good way to distinguish which came from Self Service and which were from regular policies, because, after all, Self Service policies are just policies run by a special "user initiated" trigger in the application.

As for the EA posted above, I may have been one of the people who floated the idea about capturing Self Service "launches" this way some time back. I never implemented it myself, because it's sadly unreliable. I believe it was @gregneagle who might have pointed out that the use count as well as the kMDItemUsedDates values in Spotlight can get wiped out when an application is overwritten, such as when it gets upgraded, so you can very unreliable results with that. Meaning when you upgrade your Jamf environment and Self Service gets upgraded, you can say bye-bye to those values as they get reset. Also, that only captures launches, not actual usage within the app. On one Mac, Self Service could be launched 10 times in a day and nothing ever gets installed, and on another system, it could get launched once, but 10 separate policies get run from it, before it gets quit and re-opened. On Mac 1 you'd see "10" and on Mac 2 you'd see "1" See the problem? Not a really good way of knowing actual usage.

As an aside, I suggest voting up this old Feature Request if you haven't already. It's long past time that Jamf adds some basic metrics on Self Service usage into the product. It would help so much.