Jamf Pro Policies and JamfHelper

monaronyc
Contributor

Hi Folks! Don't mean to be long-winded here but...

I'm having a tough time wrapping my head around all the various scripts available that work with installing packages via a policy in JAMF Pro along with JamfHelper. And a gang of these scripts are from outdated posts. I was wondering if anyone else is also challenged with all of this so i don't feel too embarrassed!

Does anyone know if theres a simple way to use any of the available JamfHelper scripts to work with the User Interaction tab when deploying a policy these days with El Cap, Sierra and now High Sierra? Because in using what's built into the JSS, between the time the user hits the deferred pop up box set in the User Interaction tab, to the time the machine actually restarts, theres an awkward pause/silence with no indication of what, if anything, is actually going on with the install itself. I've seen JamfHelper in action and some of what i've seen, if configured the right way, is actually pretty cool.

So what would be cool to see is to set and use the deferred pop up from the policies Interaction tab and if a user clicks yes to the pop up, JamfHelper kicks in with the full screen, -windowType fs, to initiate the install. Then once the install is done, kills the full screen and hits the machine with a restart if required. Would be nice to see and use if possible. Unless anyone has any other suggestions. I just need to figure out a better way to do our installs remotely. Any help would be GREATLY appreciated.

3 REPLIES 3

mm2270
Legendary Contributor III

There are going to be a lot of different responses to this I'd imagine. There's no one right approach. However, I think to accomplish what you're after might involve having a couple of separate policies.

As just one example of this, you can have one policy that kicks off on the schedule and triggers you specify that pop up the built in Jamf user interaction window you want, complete with the deferral options (assuming you don't want to craft your own way to do deferrals here) If the user agrees to go ahead with it, that policy can run a script that calls up JamfHelper in full screen and places the process into the background using the & character at the end of the command. The script can then continue on and call the "real" policy that does the work of installing/patching/whatever you want, by calling the policy's custom trigger or id, etc, i.e. /usr/local/bin/jamf policy -event <customtrigger>
Once that second policy is done, you can either have it do the reboot if needed within itself, or the script can kill JamfHelper and let the user continue with what they were doing.

That's the 30,000 foot overview of how that could work. I can't get into more detail right now, but that's the direction I might look at it if I were doing this.

monaronyc
Contributor

@mm2270 Thanks for this! I'm going to create a policy now with your steps. Please forgive if i come back with a gazillion and one questions.

monaronyc
Contributor

@mm2270 Hi Guys! Sorry for the delay. I finally got a chance to look at this a little deeper and so far so good! We'd like to do a little bit more with this for our users. Hoping someone can help. Here's the script we're using for the first policy (thanks to @jwojda for starting the post!)

#!/bin/bash
JAMFHELPER=`/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -title "Enter a company title here" -windowType hud -icon put path to image here -heading "place a heading here" -description "place a description to the policy here" -button1 "Yes" -button2 "Defer" -cancelButton "2"`


      echo "jamf helper result was $JAMFHELPER";

      if [ "$JAMFHELPER" == "0" ]; then
         /usr/local/jamf/bin/jamf policy -trigger (place custom trigger name here. no parentheses)
         exit 0
      else
         echo "user chose No";   
     exit 1
      fi

We'd like to see the hud window pop back up if a user defers the install. Anyone have any cool deferment scripts or ideas we can use with this to get the hud window to pop back up a few more times and then force an install?