Shea Craig's [Yo application] (https://github.com/sheagcraig/yo) as well as Julien Blanchard's Terminal Notifer are great tools, but both share a common problem. How the heck to you get a notification to run from a Casper policy? The security frameworks in OS X make this difficult. Since a casper policy runs as root, the security frameworks do not let that process make the right socket connections to the logged in user's GUI.
To "hack" this (for lack of a better word), I've used the method below. The origins of this method were built by myself and my good friend Nathan Boggs. Since then, I've developed it a little more. I really am not happy that we have to go to these lenghts, but it is what it is.
A more proper "solution" would be writing a privileged helper tool for Yo and/or Terminal Notifier.
The app can be branded as your own app or vanilla from repsective repos. It can be installed anywhere. Recommend Applicaionts, Utilities, or Application Support
e.g. /Library/Preferences/com.myorganization.notification.plist
Hidden file that simply gets "touched" by the casper policy to launch the notifiction
- Reads the values from the preference file
- Executes the notification app using those values to display desired message
Watches the trigger file. (Watch Path)
- Sees if a user is logged into GUI first. Exits if no.
- Sees if components above are installed and in right locations
- Makes sure launch agent is running
- If conditions not met, runs a "self heal function" - a "jamf policy -event customtrigger" command to reinstall the needed components
- Writes values for notification to plist
- Touches the trigger file