Posted on 03-19-2014 10:02 PM
Does anyone know how to successfully change then capture the changes made to the Notifications pane in System Preferences so I can then push the settings to end users?
I would like to change the Management Action from Banners to Alerts so the notifications I push to the users have to be manually dismissed by the user. Currently with the banner alerts users only have a couple of seconds to read the alert unless they open up notification center which they don't generally use.
Many thanks in advance.
Posted on 03-20-2014 04:59 AM
Did you try using the snapshot method on composer to see what settings are altered? I would imagine it a a bunch of plists. It wouldn't surprise me though if it is a DB in mavericks.
Posted on 03-20-2014 06:03 AM
Slightly off-topic, but is there away to manually send out notifications when new items are available in Self Service or to provide reminders of up-coming software push?
Posted on 03-20-2014 06:33 AM
@corbin3ci][/url - yes, but it involves using an app like terminal-notifier and a script. Or, if you're on version 9 of the JSS, you may be able to leverage the Management Action.app from a policy. I'm not clear on how easy it is to use the Notification Center feature in 9 just to send out notifications, but it should be possible
Edit: Also, I'm almost certain that these settings for Notification Center are stored in a SQLite db, under both 10.8 and 10.9. They aren't that easy to manipulate or push out as a result.
Posted on 03-20-2014 06:42 AM
From Item #11 of the "11 Things You Might Not Know About the Casper Suite" presentation at JNUC 2013:
/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action -title "You win" -subtitle "Thank you #JNUC" -message "That is a wrap"
Of course, you could also use cocoaDialog instead of using Notification Center.
Posted on 03-20-2014 06:53 AM
Or even via AppleScript: http://macosxautomation.com/mavericks/notifications/01.html
Which is how I guess JAMFHelper does it.
Posted on 03-20-2014 04:13 PM
@pblake There is a .db in ~/Library/Application Support/NotificationCenter/ I am trying to work out how to setup a policy to deploy it and get the users computer to use it rather than the current .db that is created on the users computer. Any thoughts?
Posted on 03-20-2014 11:56 PM
@appleconvert, not sure of the information contained in the below helps at all: https://github.com/alloy/terminal-notifier/issues/44
Posted on 04-10-2014 06:21 PM
I'd also like to change the default from banner to alert also as that way the user has a better chance of seeing the message but also can dismiss it in their own time compared to the 5sec delay currently.
i'm sure there is a way to do a sqlite change for this kinda stuff like it's done for setting the default wallpaper since apple moved away from the .plist for that setting....
Posted on 04-25-2014 01:15 PM
We are wanting to do something similar (I think). We want to disable Messages notifications since we have blocked the messages app, but it doesn't seem that we can set the preference. Anyone had any success with this?
Posted on 05-14-2014 09:06 AM
Is there anyway to automate this? Also is there a way to change the size of the window? Management wants the wording not to be truncated on a long message.
Posted on 05-21-2014 01:13 PM
@jrserapio, the window is display size is limited by Apple.
For a longer duration & more text I'd suggest looking at JAMFHelper.
Posted on 05-21-2014 02:14 PM
@bentoms Thanks for the input. I kind of figured that. I just looked into JamfHelper thanks to @stevewood post. I have seen it being mentioned before on other posts, but didn't realize what it could do (visual learner i guess). Now i just have to put JamfHelper to work for me.
Posted on 05-22-2014 01:58 PM
Hi @jserapio - you might also want to take a look at cocoaDialog version 3.x. It specifically has a window type called "notify" that, under version 3 uses an embedded version of Growl to send up small bubble notifications on the screen. In its default behavior the "bubble" window is black with white text, which isn't the nicest look to me, but the advantage is it can accept quite a bit of text without getting cut off. The bubble window expands vertically to whatever size is needed to show the text.
You can also turn off the new Growl like functionality and use the older style bubbles, which lets you specify the exact background, text and border colors to use with hex values, but then you lose the auto window expansion, so its a trade off.
Let me know if you decide to look at that and need some help with it.
Posted on 05-23-2014 08:44 AM
I filed a request with Apple a few weeks ago to allow admins to control Notification Center through the command line or other means.
Posted on 05-30-2014 09:24 AM
We did find a way to extend the "Banner" dialog box (see below). You can set the duration it sticks (which by default is approximately 5 seconds) to however long you want. Just a click on it anywhere closes it.
defaults write com.apple.notificationcenterui bannerTime SECONDS
The downside, however, is that this is a global setting for ALL banners. So we're still on a hunt to find a way to change the setting from "Banner" to "Alert" - the best solution we believe.
Posted on 02-21-2015 10:54 AM
In Mavericks and Yosemite, the preferences for Notification Center are stored in a database in /var/folders. You can find the specific database folder for the logged in user with:
On my computer the database is: /var/folders/8y/0wl97s7x46z279sv8p2h38k80000gn/0/com.apple.notificationcenter/db/db
There is a table called app_info that stores the settings. I wrote a python script that is below that will modify the database. Run with -h to see the help on using it. Run with -i to get specific Bundle IDs.
If you only want to set "Management Actions" to "Alerts" using this script you would upload this script to your JSS and run a policy with the following parameters:
1: -e com.jamfsoftware.Management-Action
2: -a Alert
Posted on 03-04-2015 11:14 AM
Posted on 03-04-2015 11:23 AM
Create new script in JSS
Paste in the contents of this script.
Create policy to run this script. Use the Parameter options. Scope and trigger.
Posted on 03-04-2015 11:31 AM
Filling in the parameter options doesn't do anything though. It just makes them accessible variables for $4 and $5 i thought. Wen I run it with those parameters filled it doesn't modify the app I'm trying. If I run the script though passing the variable from the command line it works.
Posted on 03-04-2015 06:51 PM
@jesseshipley Ah I thought you could pass hyphens through. I will update by the end of the week for Casper. You could always copy it locally first then run another policy that calls it directly with the command lines arguments.
Posted on 03-04-2015 07:36 PM
That's what I was planning to do in a worst case. Was just curious if I were missing something about the parameters.
Posted on 03-05-2015 06:07 PM
@jesseshipley Here is the updated version I tested in 10.9 upgraded from 10.8 (appears that it keeps the database in the home directory). Clean install of 10.9 and 10.10 use the /var/folder.
There are two versions now. One for Casper. Read the first couple lines to use with your policy.
Posted on 03-06-2015 10:33 AM
Thanks for the change! Only thing I notice is that you only have All, Apple, NonApple, and NonSystem now. Is there a way to pass it a specific bundle ID so you are only effecting that one?
Posted on 03-07-2015 11:55 AM
Yes, you can type in an App Bundle directly. You the first script with -i to get a list. It is possible to modify that script for an Extension Attribute as well, that would return all the notification center bundles for a computer.
Posted on 06-18-2015 06:11 PM
@matt4836 Thank you a ton for building these scripts. Exactly what I wanted. I was using this to set the Management Action prompts to Alerts. With your Casper version, there is one line I think that is missing (I added this to line 204) under the “Figure out what app” section….
elif APPS_IN_QUESTION == "CASPER": cur.execute("SELECT * FROM app_info %s"% APPS_WHERE_DICT["CASPER"])
Every other app variable was listed in the list except the Casper one. As soon as I added this line, the modifications to the Management Action notifications took. Again, thanks for the work on that script!
Posted on 08-28-2015 01:10 PM
Posted on 09-02-2015 10:54 AM
doesn't work for me im afraid even after the modifications and putting in the parameters.
error shows t: **Missing or Incorrect Application
Posted on 02-04-2016 02:04 PM
I seem to be missing something, probably obvious to someone, but I'm not seeing it - this script worked perfectly for our local casper admin account, but for any other account on the same machine or any other, it did not take. Our user accounts are Active Directory mobile accounts, but I also tested a locally created account, plus another locally created admin account. None of those took the change. Any ideas of what I've missed folks?
I will GLADLY send Matt some cash if I could get this script to work for us!!!!
Posted on 02-25-2016 08:46 PM
@ronb , I too am a big fan of @matt4836 's python script... I've been using it for months, worked like a charm in 10.10. But, please correct me if I'm wrong, I believe it is now breaking because the location of the notification database that the script looks for, in "/var/folders/" has either moved, or it is protected by SIP in 10.11.
I haven't had time to test the script on a SIP disabled 10.11 machine, but my hunch is that this is the case.
I'll +1 tho, for the continued development of the script... OR maybe we just up-vote native notification center messages from Self Service itself, here:
Posted on 02-26-2016 08:46 AM
@reelmike, I hear ya about finding time. In the mean time, I did vote-up the request you've mentioned!
Posted on 02-16-2017 03:06 PM
@matt4836 I took a look at your python script as well as some other similar open source projects and found that none of them seem to work any longer (in macOS v10.12.3).
In your research for this script, did you happen to come across a key to decoding the "flags" values found in ~/Library/Preferences/com.apple.ncprefs.plist?
There are some common recurring values such as 14, 22, 86, 535, and 663, with the higher numbers seemingly reserved for Apple applications and system services.
I have had some success with delivering settings via custom payloads in configuration profiles, but I'd like to fully understand the potential values of the flags key.
Posted on 06-14-2017 02:13 AM
Hey @milesleacy interested in your experiences with managing notifications with custom config profile. Not having any luck with disabling outlook notifications at lock screen with below as user or device profile... Seems like outlook like changes from 14 to 4110 when checking the option to not allow at lock screen...
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>apps</key> <array> <dict> <key>bundle-id</key> <string>com.microsoft.Outlook</string> <key>flags</key> <integer>4110</integer> </dict> </array> <key>sort_order</key> <integer>0</integer> </dict> </plist>
Posted on 06-14-2017 04:57 AM
@milesleacy It was a bit-shifting. If I recall 14 was the default value. 14 as binary, 000001110. By changing values from 0 to 1 turns on different preferences. Look at my script to see the values. 1 << 5 would turn on the fifth bit. Hope that helps.
Posted on 08-28-2017 07:30 PM
Did anyone figure out how to change Jamf Management Notifications to "Alerts" for 10.12 and up?
Posted on 08-29-2017 10:54 AM
This seems to work. I'd prefer some sort of documentation as to why and how, but this profile keeps my Jamf notifications set to alert (in an "MCX-often" way - that is, the user can change it, but it gets reset at the next login, even though it's a computer level profile).
This feature request is tangentially related... https://www.jamf.com/jamf-nation/feature-requests/6276/provide-full-notification-center-functonality
Posted on 08-29-2017 07:34 PM
Thank you very much for posting that!
I agree that it would be great to see some real documentation on this.
Speaking I see you changed the logo!!! how did you do that ?
Posted on 08-30-2017 01:29 PM
@ClassicII If you're referring to the notification icon below, that's my own compiled instance of yo.app, with a company icon swapped into the Xcode project before compiling.
Posted on 08-30-2017 01:33 PM
If you decide to use Yo, you can achieve the same thing we've been discussing here re: notification center alerts with your Yo app via its bundle identifier (which you can customize in the Xcode project).
Posted on 12-21-2017 10:47 AM
Does anyone know how we could simply append the com.apple.ncprefs preference file that is already there with the information described by milesleacy? When I create a config profile and just upload a .plist with the custom settings, as I suspected, it overwrites the file already there on my test machine. This would change users settings for other app notifications which is obviously not desirable. I simply want to append the file with the text below. Any ideas on how to do this successfully with Jamf? Thanks!