Hey, we are using google drive for storing and sharing business data in the company. I recently noticed that one of our staff has set up his personal account on the google drive app. So, I’ll have to limit the app to only companies’ email. Please provide a solution.
Device: mac book pro (13-inch, m1)
@nienke, Thanks for reaching out to us.
You can configure the Google Drive app such that only users in your company’s domain can sign in to the app. Hence, employees will not be able to log in to the app with their personal mail. You can do the job by executing scripts or installing custom configuration profiles on your macOS devices.
So, here is the script to restrict the Google Drive app with a domain of your choice.
1 |
sudo defaults write /Library/Preferences/com.google.drivefs.settings AllowedAccountsPattern "'.*@(gmail).com'" |
Provide your domain name instead of ‘gmail’.
You can seamlessly deploy the script to required devices via the Hexnode portal. Check out our help doc on executing custom scripts on macOS devices to learn more.
If you prefer installing a custom profile to do the task, please use the XML file below to deploy the custom configuration profile to your macOS devices using Hexnode.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<?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>PayloadContent</key> <array> <dict> <key>AllowedAccountsPattern</key> <string>.*@(gmail).com </string> <key>PayloadDisplayName</key> <string>Google drive</string> <key>PayloadIdentifier</key> <string>471A0551-7952-4E59-BA3D-A4F6F4230209</string> <key>PayloadType</key> <string>com.google.drivefs.settings</string> <key>PayloadUUID</key> <string>471A0551-7952-4E59-BA3D-A4F6F4230209</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDisplayName</key> <string>Google </string> <key>PayloadIdentifier</key> <string>9CD8F3AB-C99D-4C20-AC80-0CFBF4B7DAFF</string> <key>PayloadOrganization</key> <string></string> <key>PayloadScope</key> <string>Device</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>9CD8F3AB-C99D-4C20-AC80-0CFBF4B7DAFF</string> <key>PayloadVersion</key> <integer>1</integer> </dict></plist> |
Replace ‘gmail’ with your domain name.
After executing the script/deploying custom configuration, restart the devices for the changes to take effect. Please don’t be concerned about manually restarting all of the devices, you can easily do it from the Hexnode portal. To restart your devices remotely, go to Manage > Devices, select your Mac devices, and click Restart Device from the Actions drop-down menu.
Please try to validate the script/XML file on a system before executing in bulk. Because if there are any issues with the script/XML file, it may put your devices at risk.
Hope this helps. Do reach out if you have any further queries.
Cheers!
Evin Lee
Hexnode UEM
24 February 2022