Posted on 04-14-2022 08:15 AM
So it was decided at our school to do Drive for desktop as everyone's backup solution. However once everyone installed it, our Wifi performance crashed because Drive was taking up all of our bandwidth. After speaking with our Google agent, they suggested running the following commands in terminal in order to throttle the amount of bandwidth Drive for Desktop uses.
Solved! Go to Solution.
04-14-2022 08:25 AM - edited 04-14-2022 08:27 AM
@malexander When you run those commands manually in Terminal you're modifying the values in the user's preferences settings. When running via a Jamf Policy you're modifying the system settings, and Google Drive may not recognize those. Try the following script instead:
#!/bin/bash
runAsUser() {
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
currentUserID=$(id -u "$currentUser")
if [ "$currentUser" != "loginwindow" ]; then
/bin/launchctl asuser "$currentUserID" sudo -u "$currentUser" "$@"
fi
}
runAsUser defaults write com.google.drivefs.settings BandwidthRxKBPS 100
runAsUser defaults write com.google.drivefs.settings BandwidthTxKBPS 100
exit 0
Note: A Configuration Profile is probably a better way to enforce these settings, but if the defaults write approach works for you...
04-14-2022 08:25 AM - edited 04-14-2022 08:27 AM
@malexander When you run those commands manually in Terminal you're modifying the values in the user's preferences settings. When running via a Jamf Policy you're modifying the system settings, and Google Drive may not recognize those. Try the following script instead:
#!/bin/bash
runAsUser() {
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
currentUserID=$(id -u "$currentUser")
if [ "$currentUser" != "loginwindow" ]; then
/bin/launchctl asuser "$currentUserID" sudo -u "$currentUser" "$@"
fi
}
runAsUser defaults write com.google.drivefs.settings BandwidthRxKBPS 100
runAsUser defaults write com.google.drivefs.settings BandwidthTxKBPS 100
exit 0
Note: A Configuration Profile is probably a better way to enforce these settings, but if the defaults write approach works for you...
Posted on 04-14-2022 08:33 AM
thank you! that worked perfectly. Appreciate it!
Posted on 04-14-2022 08:58 AM
Offering an alternative solution — not that it's better than a script but to raise awareness for a Jamf Pro feature that can accomplish the same thing.
Those details of the defaults commands Google provided can be use to create configuration profiles to do the same thing. Jamf Pro supports custom manifests and the manifest below exposes the same controls plus more options for Google Drive.
Here's the manifest:
https://github.com/Jamf-Custom-Profile-Schemas/ProfileManifestsMirror/blob/main/manifests/ManagedPre...
And here are instructions for using it:
https://github.com/Jamf-Custom-Profile-Schemas/jamf-manifests/wiki
Posted on 04-14-2022 09:01 AM
that's great. I was toying with the idea of doing a config profile, but Ive never used them before and am a little afraid to use them. But this is great information. Appreciate it.