Prompt User to Enable Screen Recording (with Popup/GIF)

JRM5513
New Contributor III

Greatly inspired by this thread, I re-wrote a Ventura-ready script prompting the end user to enable Screen Recording for a given app. The Privacy & Security window will open automatically and the popup/gif loops until the user grants access.

In my company, the script is deployed at the end of the enrollment so the support team doesn't forget to enable screen recording for Google Chrome. This way, the user won't have to restart his browser the first time he wants to share his screen to somebody.

Script : enable_screen_recording.sh
Extension Attribute (Optional) : enable_screen_recording_ea.sh
Requirement : IBM Notifier
Blog post (French) : Autoriser l’enregistrement de l’écran (TCC/PPPC) à l’aide d’un popup tutoriel

If you test the script in your Terminal, give it full disk access so it can read the TCC.db file.

xBvE5ka

7 REPLIES 7

AJPinto
Honored Contributor II

With how much user interaction Apple requires on macOS. Apple really needs to bake something like this in to the OS. Either direct a user how to deal with a popup, or provide a link that will send the user to an Apple page with screenshots or a video on how to do the thing (apples text walls are not good enough).

sudoErase
New Contributor III

Hello @JRM5513 ! 

Thank you for this! 

I have some questions:
I tried to test this on Jamf Pro and it looks like we will still need Terminal for Full Disk Access.

From above script, I thought we need Full Disk Access when testing on Terminal but when I tried to run this on Jamf Pro, it looks like we need Full Disk Access on Terminal either way to complete.

 

Are you able to get this running without Full Disk Access on Terminal when pushing from Jamf Pro?

sudoErase
New Contributor III

Running script Google Chrome (Google Meet) Screen Recording Prompt...

Script exit code: 0

Script result: Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied

Waiting for 2...

Opening Screen Recording Privacy

 

0

Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied

Waiting for 2...

Opening Screen Recording Privacy

 

0

Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied

Waiting for 2...

Opening Screen Recording Privacy

 

0

Google Chrome permission has been enabled

1st try Error: Chrome uncheck (Screen Recording) and Terminal unchecked (Full Disk Access)
2nd try Error again: Chrome check (Screen Recording) but Terminal unchecked (Full Disk Access)
3rd try Successful: Chrome check (Screen Recording) and Terminal checked (Full Disk Access)


Issue with this is: 
We cannot push users to checkmark Full Disk Access on Terminal without the prompt when end users can't even checkmark Chrome 😂

JRM5513
New Contributor III

Hello sudoErase,

If you are pushing it with Jamf, yon don't need to allow Terminal full disk accesses, but the Jamf agents instead. With the help of PPPC Utility, I would create a configuration profile for the following binaries :

/Library/Application Support/JAMF/Jamf.app
/usr/local/jamf/bin/jamf

A similar profile was already deployed on my computer before I created the script, maybe that's why I didn't have error. I will update the original post if fixes your issue.

sudoErase
New Contributor III

Do you have the profile again? I was cleaning my computer and lost it. It looks like the site is down. :( 

sudoErase
New Contributor III

Thank you!