Need to display a popup message for os update with steps to all devices

bravichandran
New Contributor III

HI,

Need to display a popup message for os update with steps to all devices. We have created a test policy and using interaction tab displayed the message with test devices. but unable to expand the notification and its very small too to miss. is they any script file to display the message notification in a frequent time intervals until the os got updated on that device.

6 REPLIES 6

AJPinto
Honored Contributor III

You can either use Nag, or JAMF Helper. There are other tools, but its really down to what you want to do. What tool are you currently using?

jamfpro

 

Fluffy
Contributor III

https://github.com/macadmins/nudge

If you look in the wiki, there is a section specifically for a guide to use in Jamf Pro.

This is the way

BM-Degenkamp
New Contributor III

I know its an older topic, but I am looking for the same at the moment. Is there any news on it from Jamf's perspective? Something Jamf native?

AJPinto
Honored Contributor III

Its best to make your own JAMF nation post. However this is what I do.

 

I have this script on a policy that runs daily. If the Mac has OS updates it will prompt the user, when they click Acknowledge the script will open the software updates preference pane. You can be more verbose in the direction if you need to be. If there are no updates it just exits. If the user clicks differ the result is logged in JAMF, and the option to differ can be removed, you could also make this a full screen notification rather than just a window.



 

#!/bin/bash


loggedInUser=$(/usr/bin/who | awk '/console/{ print $1 }')


if [[ $loggedInUser != '' ]]
then
	echo "$loggedInUser is logged in, proceeding with script."
else
	echo "No logged in user, exiting."
	exit 0
fi

#*=============================================================================
#* JAMF Helper Dialog
#*=============================================================================

jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
loggedInUser=$(/usr/bin/who | awk '/console/{ print $1 }')
windowType="hud"
description="Hello,

Technology has identified your computer as having available Software Updates. Please install any available Software Updates as soon as convenient.

- Clicking Acknowledge below will open the Software Update Pane in System Settings, you may install any available software updates
- If Defer is selected you will be prompted again tomorrow
- You may manually navigate to System Settings > General > Software Update


Thank you for helping to make sure that your computer remains updated and secure. If you need assistance, please contact the support center at {number here}.


"
heading="Critical MacOS Updates: Action Required"
button1="Acknowledge"
button2="Defer"
icon="/Library/Desktop Pictures/DesktopBG-8x5-v4.jpg"
title="MacOS Updates Available" 
defaultButton="1"
cancelButton="2"
iconSize="240"

#*=============================================================================
#* Begin JAMF Helper
#*=============================================================================

#Checking to see if the device has available OS updates, if updates are available prompt user with JAMF Helper else exit.
OS_Update_Status=$(sudo softwareupdate -l | grep "Title")

if [[ $OS_Update_Status != '' ]]
then
	echo "Updates Available, prompting user."
	#Running JAMF Helper
	userChoice=$("$jamfHelper" -windowType "$windowType" -title "$title" -heading "$heading" -description "$description" -defaultButton "$defaultButton" -cancelButton "$cancelButton" -icon "$icon" -iconSize "$iconSize" -alignHeading "$alignHeading" -button1 "$button1" -button2 "$button2")
	
	#Opening Software Update or Differing based on user choice
	if [ "$userChoice" == "0" ]; then
		echo "$loggedInUser clicked Acknowledge, Opening Software Update Preference Pane."
		open -b com.apple.systempreferences /System/Library/PreferencePanes/SoftwareUpdate.prefPane
		exit 0 
	elif [ "$userChoice" == "2" ]; then
		echo "$loggedInUser clicked "Defer"; now exiting."
		exit 0
	fi
else
	echo "Device Reporting no available updates, exiting"
fi



#*=============================================================================
#*End JAMF Helper
#*=============================================================================