Skip to content

Instantly share code, notes, and snippets.

@smashism
Last active October 11, 2019 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smashism/ce0781a3079faa291f7f921a4344dc7d to your computer and use it in GitHub Desktop.
Save smashism/ce0781a3079faa291f7f921a4344dc7d to your computer and use it in GitHub Desktop.
Add this to a policy in Jamf Pro to send a notification in a more controlled manner than the Start/End notifications in user interaction settings.
#!/bin/bash
###
#
# Name: management-action-by-policy.sh
# Description: This script is designed to run with policies to use
# Management Action.app to send a push notification to
# a managed Mac.
# Use: 1- Add script to Jamf Pro server, and optionally add
# parameter lables that match the parameters below.
# 2- Add to a policy, populating the parameters with
# the text you'd like to see in the notification bubble.
# Note: There is limited space in a bubble so these notifications
# need to be brief. You can get away with one decent-sized
# sentence or two short sentences. If you use the subtitle
# it eats into the space of the message text.
# Author: Emily KW
# Created: 2019-10-11
#
###
title="" # "string"
subtitle="" # "string"
message="" # "string"
[ "$4" != "" ] && [ "$title" == "" ] && title=$4
[ "$5" != "" ] && [ "$subtitle" == "" ] && subtitle=$5
[ "$6" != "" ] && [ "$message" == "" ] && message=$6
"/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action" -title "$title" -subtitle "$subtitle" -message "$message"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment