Posted on 04-02-2018 10:01 AM
Hello all,
I work at a school and we have a need to push out a splash screen of sorts. We would like to remind the seniors of up and coming marching, and laptop turn in time frames. I have read several posts about how to create banners or login screens, but not sure this would be appropriate in our instance. We need a splash screen to appear, at set time intervals and have an "Accept" button at the bottom, and only for seniors. Senior group is no problem, I will just create a smart group... but the rest is beyond my ability, scripting is not my first love... nor 15th either. LOL
We are currently on JAMF PRO 10.3, and most systems are on 10.12.6.
Any ideas or help is greatly appreciated
Posted on 04-02-2018 10:34 AM
This sounds familiar. Did you start another discussion thread a few days back about this?
Anyway, I'm going to guess that something that comes up on screen at login/logout isn't going to suffice, because, Mac users - we never log out, unless we're forced to, right?
If that assumption is correct, you would be looking at using something like jamfHelper, or Management Action (User Interaction tab in a policy) Or, if you wanted to use a 3rd party tool, there is cocoaDialog (previous 3.0 beta, not the current "beta" which isn't functional yet), or Yo from Shea Craig.
Here is a very quick example of using jamfHelper to bring up an on screen window
#!/bin/bash
"/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper" -windowType hud -title "Important Notification" -heading "Notice on <insert topic here>" -description "<Put your full message here.>" -button1 "Accept" -lockHUD
There are several more options that jamfHelper includes, so take a look at the help page for it to see more"/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper" -help
As far as having it come up at specified times in the day, I'd first look at the policy client side options to see if you can restrict it to come up at the times you want. That may or may not be enough flexibility, depending on what it is you really want to do there.
Posted on 04-03-2018 08:09 AM
Hi
This might help, not sure about the timing aspect though.
https://www.jamf.com/jamf-nation/third-party-products/files/952/displaymessage-sh-display-a-message-to-the-end-user
Description
This script will display a message to the end user with a specified message. The message can be backgrounded so that a message is displayed and a process such as a policy is delayed until a user clicks the "OK" button. By default, the process will not be backgrounded and subsequent scripts or commands that run after this script will be delayed until a user clicks "OK".
Posted on 04-03-2018 09:06 AM
Would you need the accept button to perform some sort of action or just record their responses?
You can use something like this. It would just display if they pressed accept or decline in the logs
#!/bin/bash
#
####################################################################################################
# HARDCODED VALUES SET HERE
winHeading="Message To Seniors" #Custom text heading top of the window
winDescription="Please hand your computers in by xx/xx/xx" #Custom text heading in the window
####################################################################################################
#
# SCRIPT CONTENTS - DO NOT MODIFY BELOW THIS LINE
#
####################################################################################################
JHELPER=$(/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -icon /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/Resources/Message.png -heading "${winHeading}" -description "${winDescription}" -button1 "Accept" -button2 "Decline" -cancelButton "2")
if [ "${JHELPER}" == "0" ]; then
echo "User Pressed Accept"
exit 0
else
echo "User Pressed Decline"
exit 0
fi
Posted on 04-03-2018 09:45 AM
I've been doing this for years using the "User Interaction" section of a policy. Just put the text you want the message to say in the "Start Message" box. Then in the "Complete Message" box, put in an acknowledgement text. Because both are filled in, the policy will force the end-user to click an "Submit" button to see the 2nd half. The message won't go away until they click the "Submit" button and then click the "Submit" button.
Here is how the end-user sees it. (Please ignore that my policy text doesn't match the end-user text. I pulled the screenshots from different places.)
While this won't FORCE a user to read the message, it is more than just a single dismissible message box. It also looks a bit different than other dialogue boxes they may have gotten into the habit of dismissing. This policy works pretty well for us, and I just update it every year with the different due dates and scope it to a new Senior class.
Posted on 04-03-2018 09:49 AM
Oh, and I set the policy to run once per day, triggered by the Every 15 min trigger, so it's somewhat persistent and in their faces but not crazy obnoxious. We've had pretty good success with this messaging. Keep in mind that we also meet with the Senior class in person at their last class meeting. I hand out a flyer that has some of this same info and dates on it. I also set up a SignupGenius so that any Senior who needs help migrating data to a newly-purchased Mac can get my help in doing so.
Posted on 04-03-2018 09:55 AM
Just to clarify something that may help visualize this that took me a few tries to picture in my head the first time I did this, what ever you put between the
""
after '-description' will appear exactly as you write it.
#!/bin/bash
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "My Pretty window Title" -description "However you decide
to format this
1) will appear
2) within the quotes" -button1 "I Understand" -timeout 300
You can also give it actions based off the button received by making your response variable.
#!/bin/bash
HELPER=`/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "Reboot Needed" -description "Your computer has not been rebooted recently!
Please restart your workstation at your earliest convenience and at the end of each work day going forward.
Rebooting daily will allow you to avoid being caught off guard at an inconvenient time by automatic system reboots. Everyone who uses a corporate workstation should reboot their workstations on a daily basis to ensure that proper system and security updates are applied. Thank you for your prompt attention and cooperation in keeping workstations safe and functioning efficiently!
Please search for the term 'reboot' in the Information Protection Acceptable Use Policy (AUP) for more information." -button1 "Reboot Now" -button2 "OK" -cancelButton "2" -timeout 300`
echo "jamf helper result was $HELPER";
if [ "$HELPER" == "0" ]; then
jamf reboot
exit 0
else
echo "user acknowledged";
exit 1
fi
Posted on 04-04-2018 03:17 AM
@mm2270 Yes I posted a discussion a few days back, but could not locate it. I assumed, wrongly too, that I forgot to Post It... And yes we never turn off our Macs unless we have an OS update/Upgrade that offers much more stability, security or bells and whistles.
I like that simple script. I see others have scripts too, which I will look at and try on a test device. Then will decide which one meets our needs and go with that.
Thanks all for your scripting god-like skills.
R
Posted on 04-04-2018 03:27 AM
@damienbarrett what does the "Start" drop-down perform? Does this restart the device as well or is that non-working?
This looks good too.
Thanks
Posted on 04-04-2018 08:15 AM
It just fires off the 2nd half of the message -- in this case, the acknowledgement message. I do agree that it's not the best wording (Start now? Start what? It's just a message; nothing's starting). But this is the framework that's built into the User Interaction portion of a policy, so we're stuck with it. It's not modifiable in any way that I know.