Show output un Self service app

New Contributor III

Hi All,

Wondering how to show output in the self service app. Like when in terminal executing sudo jamf policy it shows what it is doing. I'd like to see the same in the self service app.


Legendary Contributor III

Hmm, natively the Self Service application will only show names of items its executing, like what script its running by name, but isn't going to show the output of that script. I think most people would not want it to as its often too much information for the average user of Self Service.

The only thing I can think of would be to use a 3rd party tool like cocoaDialog with the progress bar mode and feed the command output back to the app to update the progress bar text with what its doing. I've done things like that before when its been needed, so that's a possibility.

Can you elaborate a little more on exactly what your vision is for this? What are you trying to solve here?

Valued Contributor II

not to hijack the thread, but I can see a use case for adobe RUM. The only way to find out what it's actually doing when run through Self Service is to have the end user go into Console, find and open the .log file from there. A more user friendly method would be helpful.

New Contributor III

Well I'd like to be able to give some more control to some teachers on a remote location to use the self service app. If they could somehow see a little bit more output that would be valuable to us system admins. That way we can make some useful tools available to them by self service without them needing us all the time. If something goes wrong they're able to give us some more info other than only the policy was run.

Legendary Contributor III

@DeployAdam Would this only be for a select number of policies, or are you looking for a way that details would always be shown for anything they run from Self Service? If its the former, I can see some possibilities, but part of it will depend on the kind of policies they are, i.e. what's actually happening in them.
If you wanted this on any policy, that's going to complicated, since its just not part of how Self Service works.

Valued Contributor II

What I do is, In the Self Service Policy you can add a Message in the policies User interaction tab using the 'Start Message' and 'Complete Message' text areas. This will show those messages within the Mac OS notifications

New Contributor III

I was thinking about perhaps extending a policy with a script that shows detailed progress of the selfservice run policy. So looking for just a little bit more tan a 'Complete" message after a self service policy has ran.

Legendary Contributor III

@DeployAdam I get what you're saying. As I mentioned, it is possible to do this, but its not the easiest thing to do for a number of reasons.
One, you can't simply scrape the jamf.log. If you look at your jamf.log, unfortunately, it has little detail on the policy steps. It usually just states what policy its executing, but won't list out the individual steps that made up that policy.
You can get that output by running something like sudo jamf policy or sudo jamf policy -trigger/-id <something> and piping the output from that back into something else to display to the user. But unfortunately, this usually means you need to have 2 policies. One that the user triggers from Self Service, but then that runs a script which calls the actual policy with one of the commands like above, for example, and captures the output. I dislike the idea of creating 2 policies for every Self Service policy I manage, but sometimes its necessary to get the flexibility we're looking for. I'm not sure how you feel about that yourself.


Just a thought. You could put in your script Apple Script Dialog boxes that display where it is at in the message or any errors. Something like this:


currentUser=$(stat -f%Su /dev/console)
userUID=$(dscl . read /Users/$currentUser UniqueID | awk {'print $2'})

launchctl asuser $userUID /usr/bin/osascript <<EOF
display dialog "Enforcing MDM Profiles" with title "MDM"


jamf mdm

The code above is just a quick write up and will need to be tested. Anyways, just an idea.


Shawn G

Valued Contributor III

Specifically for your use case, one thing I use occasionally for feeding back info like that is to have a script just open the log/txt/etc... file into Safari or another browser. You could use another program or specifically Console for log files, although I quite like the browsers as they tend to take and display just about any file type reasonably well.