For over a decade MacAdmins have been successfully using this preference in scripts and later in configuration profiles to disable AirDrop. However the payload is not officially documented by Apple.
Another preference that Apple has not documented is the ability to configure the discoverability settings of AirDrop: Everyone, Contacts Only or No One.
The method to set this preference has been revealed over the years, but a recent discussion in the MacAdmins Slack made me realize it has not been widely shared. Read on for the details.
The original unofficial preference from 2011 is the boolean DisableAirDrop key in the com.apple.NetworkBrowser payload. It requires the user to logout before taking effect but when set to true completely disables AirDrop by removing the feature from the Finder.
Apple’s officially documented way to disable AirDrop is in the Restrictions profile by setting the allowAirDrop key in com.apple.applicationaccess payload to false. This value is the reverse of the older method but the end result is the same.
As of macOS 12.2.1 both payloads work to disable AirDrop, however I would recommend using the latter moving forward.
The above methods are great for companies that need to disable AirDrop compeltely, but are not helpful when the desire is to leave AirDrop enabled but restrict which other Macs and iPhones can discover the computers in your fleet. This is where the new preference payload comes into play.
Users are able to pick between three options in the Finder that control the discoverability of their Mac by other devices: Everyone, (iCloud) Contacts Only or No One.
To control these options admins can configure the DiscoverableMode key in the com.apple.sharingd payload with string values of: “Everyone” or “Contacts Only” or “Off” Doing so takes effect immediately with no need for the user to logout and back in, as is required when disabling AirDrop completely.
I tested this in macOS 12.2.1 and it works as expected. However unlike typical behaviour with configuration profiles, enforcing this setting does not disable the GUI controls. Users are still able to change between the three options, however doing so has no effect, and the GUI will revert when the Finder window is closed and reopened.
This option can also be scripted which could prove useful in scenarios where you want to allow users to occasionally choose a more permissive setting, but have it automatically revert with a scheduled script.