Enable AirPlay Receiver

micmil
New Contributor III

There's plenty of posts regarding disabling AirPlay Receiver, but we actually want to ENABLE it. Our previous AirPlay solution, AirServer, is not being properly maintained by the dev, doesn't play nice on our network, and we have just about given up on it.

I tried reversing @ljcacioppo 's solution for disabling the setting here, but when set to true, it doesn't toggle the setting on; it only allows the user to enable it. This is on Seqouia 15.5. Ideally, we would like the following things set via profile:

  • AirPlay Receiver set to ON
  • Allow AirPlay for Anyone on the Same Network
  • Require password set to OFF (the user must click a popup to allow the connection so this is fine)

Does anyone have a working solution for this?

1 REPLY 1

dmccluskey
Contributor II

this script should do it.

 

 

#!/bin/bash

loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
#hostId=$(system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -d ":" -f2 | xargs)
sudo -u "$loggedInUser" defaults write "/Users/$loggedInUser/Library/Preferences/ByHost/com.apple.controlcenter.plist" AirplayReceiverAdvertising -int 3