You can manage so many more settings than Apple documents.
Apple’s list of supported management keys for configuration profiles is slowly growing, though some listed on their own support site no longer apply or work for current versions of macOS. If you want the official Apple documented supported settings for configuration profiles there’s two places, Apple’s developer documentation and an Apple support page
https://developer.apple.com/documentation/devicemanagement/profile-specific_payload_keys
https://support.apple.com/guide/mdm/complete-payload-list-mdm5370d089/1/web/1.0
The developer documentation is nice because it lets you know what keys have been updated and changed. The complete payload support page is nice because it gives a little more description about each setting.
But…But…But…there’s so much more, so many more settings you can manage with a configuration profile! So, what if you want to manage settings not listed in those documents…there’s a few ways to track down what is being set when a setting is changed.
One other way that rarely works but is worth mentioning, is running the strings command against a binary and just taking an educated guess about what could be a configuration profile key in the text returned. If it’s an application bundle then in the Info.plist you’ll have the CFBundleIdentifier which would be the preference domain. This is the least likely method, but it has been used to find undocumentated configuration profile keys before.
Now that you know how to track down what’s changed, how do you make a configuration profile to deploy with your MDM to enforce the setting.
The most likely way that things will work is just making a configuration profile to control that preference domain directly.
Here’s an example of a Configuration Profile to enforce “Contacts Only” for AirDrop. Under the PayloadContent is the PayloadType which is com.apple.sharingd. I got that value from the plist file name that changed, com.apple.sharingd.plist. The key was called DiscoverableMode and the two settings were Contacts Only or Everyone.
So you’ll notice in the PayloadContent section of the configuration profile we’re setting the PayloadType to com.apple.sharingd which was the same as the plist file name. Then in that same PayloadContentsection the key is set to DiscoverableMode, which is the same key as found in the plist with the string value of Contacts Mode.
Occasionally, this method of managing the domain directly will not do the trick and you must use ManagedClient preferences.
So your payload content section would look something like this…
You can manually install this configuration or sign it and push it out with the MDM of your choice.
Now that the profile is installed, how can you tell that it’s working…not every setting and application uses the preferences daemon.
I used a lot of these tricks in hunting down preferences and settings for the macOS Security Compliance Project (https://github.com/usnistgov/macos_security). Even if you aren’t in a regulated industry, the project may be of interest to you for managing some undocumented settings.
These views are my own and not the views of my employer. If you have any questions or want more information on this, feel free to contact me on the MacAdmins Slack(boberito), Linkedin(linkedin.com/in/bob-gendler-8702014) or email(bobgendler@gmail.com).