Posted on 01-31-2017 11:59 AM
I'm trying to set up a plist that will have defaults settings for the new OneDrive Sync Client released 1/27/17.
This new client enables users to also sync SharePoint folders to their Macs just like the Windows client.
So, following the instructions in the article "Configure the new OneDrive sync client on macOS," I've made the following plist. However, I'm not sure if I set the DefaultFolder path string correctly.
After looking at other plists in my ~/Library/Preferences folder that point to specific file paths, I think I have the right syntax.
I want to turn this plist into a custom Configuration Profile to deploy to all my clients once I can test that it works. If anyone has experience with setting a default file path in a plist, and can check my work, that would be great.
<?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>DisablePersonalSync</key>
<true/>
<key>TeamSiteSyncPreview</key>
<true/>
<key>Tenants</key>
<dict>
<key>Tenant ID</key>
<dict>
<key>DefaultFolder</key>
<string>file:///$HOME/OneDrive%Folder%Path/</string>
</dict>
</dict>
</dict>
</plist>
Posted on 01-31-2017 12:42 PM
@itupshot Thanks for the heads-up. Here's what we're using (where "123abc-456def-789ghi" is your Tenant ID):
ScriptLog "Configure future users ..."
for USER_TEMPLATE in "/System/Library/User Template"/*
do
# Block configuring and syncing of personal/consumer OneDrive accounts
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac DisablePersonalSync -bool True
# Create user's default OneDrive directory
/bin/mkdir -p "${USER_TEMPLATE}"/Documents/OneDrive - Company Name
# Set the default location for the local "OneDrive - {tenant name}" folder
/usr/libexec/PlistBuddy -c "Add :Tenants:123abc-456def-789ghi:DefaultFolder string '~/Documents/OneDrive - Company Name'" "${USER_TEMPLATE}"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
done
Posted on 01-31-2017 03:10 PM
@dan.snelson From your script, it looks like the DefaultFolder string should use the ~ for the user's home folder.
It's interesting that you're inserting these settings in the User Template, and not applying them in a Config Profile. We were using a Config Profile for the Mac App Store version of the OneDrive Client, but we were not setting the DefaultFolder location because I didn't know how to do it until I read the updated instructions for the new standalone client.
I'm going to try ~/OneDrive - [Company Name] as the DefaultFolder string for my test, and if it works, then I can use it for my deployments.
Posted on 01-31-2017 06:25 PM
Microsoft's documentation for this stinks; would it be so hard for them to provide actual example code that is usable (i.e. "OneDrive - Contoso", and an actual dummy tenant guid)? I've complained to our TAM several times, and it is better than it was, but not 100%yet. There is a fairly active OneDrive channel on the MacAdmins Slack, going to try direct feedback there, as the Product Manager (i think) hangs out there regularly. Really great asset if anyone hasn't tried it yet, and no cost.
I'm also working on making OneDrive redirection work on Mac, by symlinking the Desktop and Documents directories to a Backup directory inside the user's OneDrive. I'm hoping to get it to the point i can merge Windows and Mac onto one, so changing platforms is as easy as logging in to OneDrive and waiting for your stuff to come down!
Posted on 02-01-2017 09:25 AM
@KSchroeder Yeah, their documentation does not give good examples. However, based on @dan.snelson 's reply, I think I got a working plist that I just turned into a Config Profile. Actually, I made two Config Profiles: one for the App Store edition (which we're currently using), and one for the stand-alone edition that I want to start testing.
If my tests are successful with both Configs, I'll make sure to post a little script here for folks to grab.
I was just reading the OneDrive redirect article for Windows. This could be very useful for Macs too, but it would require a bit of work.
Posted on 02-01-2017 09:40 AM
Here's what I have so far...it works and processes all local users, so long as they don't have any open files in Documents or Desktop folders:
#!/bin/bash
######################################################################################################
# OneDrive-Redirection.sh
#
# By: Kyle Schroeder
#
# Migrates users' Documents and Desktop folders from their local home directory (/Users/userid)
# to their OneDrive - Company folder. Checks if /Users/userid/OneDrive - Company folder exists
# already, then checks that the folders haven't already been migrated or symlinked to
# a different location. If the directories are present, then they are moved into the
# OneDrive folder, and a SymLink created in the /Users/userid directory pointing to the new
# location.
#
# 1.6.16 - 1.0 - Initial version
#
######################################################################################################
#Create a list of mobile user accounts who always have a UniqueID of greater than 1000
mobileuserList=`dscl . list /Users UniqueID | awk '$2 > 1000 {print $1}'`
redirectionFolderBase="/Mac/Backup"
jamfHelper = "/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
jamf displayMessage -message "Please close all open applications and files, about to redirect data in
the Desktop and Documents folders to OneDrive!"
# Iterate through each user in the system
for mobileuser in $mobileuserList ; do
# path to where the user's OneDrive - Company folder should exist
userOneDriveBasePath="/Users/$mobileuser/OneDrive - Company"
# full path to the root of where the backup files will be stored
oneDriveBackupPathBase=$userOneDriveBasePath$redirectionFolderBase
# Only continue if the user's OneDrive - Company folder exists
if [ -d "$userOneDriveBasePath" ]; then
# Move Documents folder to OneDrive
if [ -d "/Users/$mobileuser/Documents" ] && [ ! -L "/Users/$mobileuser/Documents" ]; then
echo "Moving Documents folder to OneDrive, please wait..."
mv /Users/$mobileuser/Documents $oneDriveBackupPathBase/Documents
ln -s "$oneDriveBackupPathBase/Documents" /Users/$mobileuser/Documents
echo "Moved Documents folder to $oneDriveBackupPathBase/Documents"
jamf displayMessage -message "Moved Documents folder to OneDrive - Company/Mac/Backup/Documents"
else
echo "Documents folder NOT found or is a symlink for user $mobileuser. Maybe already migrated?"
jamf displayMessage -message "Documents folder NOT found or is a symlink for user. Maybe already migrated?"
fi
# Move Desktop folder to OneDrive
if [ -d "/Users/$mobileuser/Desktop" ] && [ ! -L "/Users/$mobileuser/Desktop" ]; then
echo "Moving user Desktop to OneDrive, please wait..."
mv /Users/$mobileuser/Desktop $oneDriveBackupPathBase/Desktop
ln -s "$oneDriveBackupPathBase/Desktop" /Users/$mobileuser/Desktop
echo "Moved Desktop folder to $oneDriveBackupPathBase/Desktop"
jamf displayMessage -message "Moved Desktop folder to OneDrive - Company/Mac/Backup/Desktop"
else
echo "Desktop folder NOT found or is a symlink for user $mobileuser. Maybe already migrated?"
jamf displayMessage -message "Desktop folder NOT found or is a symlink for user. Maybe already migrated?"
fi
else
echo "OneDrive NOT setup for this user, or it is not in the proper default location ($userOneDriveBasePath)!"
echo "Please configure OneDrive for $mobileuser first and place the OneDrive folder in the default (~)."
fi
done
I need to do checking/prompting for open files on the ~/Desktop and ~/Documents (which is why the jamfHelper variable is in there; haven't got those setup yet), and probably tweak the paths...but it does work as-is right now. Replace "Company" with your Tenant name, of course.
Posted on 02-02-2017 10:13 AM
What happens if the user hasnt setup/configured OneDrive yet ? Do you have any method to force this with the script ?
Posted on 04-11-2017 05:23 PM
Kickstarting this thread...has anyone figured out how to replace Stand Alone version of OneDrive, with App Store version of OneDrive without losing Sharepoint sync?
Posted on 05-25-2017 08:09 AM
Wish someone who has managed to get a plist working to automatically select the home folder for the stand alone version could post that here.
Posted on 05-25-2017 08:19 AM
@mccallister You're welcome to use the following script as a rough guide; you'll need your Tenant number and to replace "Company Name":
#!/bin/sh
####################################################################################################
#
# ABOUT
#
# Configure defaults for Microsoft OneDrive
# See: https://support.office.com/en-us/article/Deploying-the-OneDrive-Next-Generation-Sync-Client-on-OS-X-and-configuring-work-or-school-accounts-eadddc4e-edc0-4982-9f50-2aef5038c307?ui=en-US&rs=en-US&ad=US
#
####################################################################################################
#
# HISTORY
#
# Version 1.0, 5-Jul-2016, Dan K. Snelson
# Configure User Template and all Current Users
#
####################################################################################################
# Import logging functions
source /path/to/client-side/functions.sh
####################################################################################################
ScriptLog "###############################################"
ScriptLog "#### Configure Microsoft OneDrive Defaults ####"
ScriptLog "###############################################"
ScriptLog "Configure future users ..."
for USER_TEMPLATE in "/System/Library/User Template"/*
do
# Block configuring and syncing of personal/consumer OneDrive accounts
/usr/bin/defaults write "${USER_TEMPLATE}"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac DisablePersonalSync -bool True
# Create user's default OneDrive directory
/bin/mkdir -p "${USER_TEMPLATE}"/Documents/OneDrive - Company Name
# Set the default location for the local "OneDrive - {tenant name}" folder
/usr/libexec/PlistBuddy -c "Add :Tenants:nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn:DefaultFolder string '~/Documents/OneDrive - Company Name'" "${USER_TEMPLATE}"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
done
ScriptLog "Configure current users ..."
for USER_HOME in /Users/*
do
USER_SHORTNAME=`basename "${USER_HOME}"`
if [ ! "${USER_SHORTNAME}" = "Shared" ]; then
if [ ! -d "${USER_HOME}"/Documents/OneDrive - Company Name ]; then
mkdir -p /Users/"${USER_SHORTNAME}"/Documents/OneDrive - Company Name
chown -R "${USER_SHORTNAME}" "${USER_HOME}"/Documents/OneDrive - Company Name
fi
if [ -d "${USER_HOME}"/Documents/OneDrive - Company Name ]; then
# Kill OneDrive
ScriptLog "* Quit OneDrive for ${USER_SHORTNAME} ..."
processName="OneDrive"
/usr/bin/pkill -l -U "${USER_SHORTNAME}" "${processName}"
# Block configuring and syncing of personal/consumer OneDrive accounts
ScriptLog "* Block ${USER_SHORTNAME} from adding personal/consumer accounts ..."
/usr/bin/sudo -s -u "${USER_SHORTNAME}" /usr/bin/defaults write /Users/"${USER_SHORTNAME}"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac DisablePersonalSync -bool True
# Create user's default OneDrive directory
ScriptLog "* Create ${USER_SHORTNAME}'s default OneDrive directory ..."
/bin/mkdir -p /Users/"${USER_SHORTNAME}"/Documents/OneDrive - Company Name
ScriptLog "* Set permissions on ${USER_SHORTNAME}'s default OneDrive directory ..."
/usr/sbin/chown -Rv "${USER_SHORTNAME}" /Users/"${USER_SHORTNAME}"/Documents/OneDrive - Company Name/
# Set the default location for the local "OneDrive - {tenant name}" folder
ScriptLog "* Set ${USER_SHORTNAME}'s default location for the local OneDrive folder ..."
/usr/libexec/PlistBuddy -c "Add :Tenants:nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn:DefaultFolder string '/Users/${USER_SHORTNAME}/Documents/OneDrive - Company Name'" /Users/${USER_SHORTNAME}/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
# Enabling Finder integration
ScriptLog "* Enabling Finder integration for ${USER_SHORTNAME} ..."
/usr/bin/sudo -s -u "${USER_SHORTNAME}" /usr/bin/pluginkit -e use -i com.microsoft.OneDrive-mac.FinderSync
ScriptLog "Correct permissions for ${USER_SHORTNAME} ..."
/usr/sbin/chown -Rv "$USER_SHORTNAME" /Users/${USER_SHORTNAME}/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist 2>/dev/null
# Reload preferences
ScriptLog "Reload preferences for ${USER_SHORTNAME} ..."
/usr/bin/pkill -l -U "${USER_SHORTNAME}" cfprefsd
fi
fi
done
jssLog "Microsoft OneDrive Defaults Configured"
exit 0
Posted on 05-25-2017 10:42 AM
Dan, I take it that just works with the app store version?
Posted on 05-25-2017 10:52 AM
@mccallister Correct, we're currently deploying the Mac App Store version of OneDrive.
Posted on 05-30-2017 06:23 PM
Stand Alone deployment turned out to be a challenge, since it has to be launched as the current user.
Launch Agent:
#!/bin/bash
theApp="/Applications/OneDrive.app"
launchAgent="/Library/LaunchAgents/com.MYCOMPANY.onedrive.plist"
## Set prefs User Template
/bin/mkdir -p /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/
/usr/bin/touch /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
/usr/bin/defaults write /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist DisablePersonalSync -bool TRUE
/usr/bin/defaults write /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist Tenants '<dict><key>(TenantID)</key><dict><key>DefaultFolder</key><string>OneDrive - The Company Name</string></dict></dict>'
/bin/chmod -R 700 /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
/usr/sbin/chown root:wheel /System/Library/User Template/English.lproj/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
## Set prefs Users
over500=$( dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }' )
for u in $over500 ;
do
/bin/mkdir -p /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/
/usr/bin/touch /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
/usr/bin/defaults write /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist DisablePersonalSync -bool TRUE
/usr/bin/defaults write /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist Tenants '<dict><key>(TenantID)</key><dict><key>DefaultFolder</key><string>OneDrive - The Company Name</string></dict></dict>'
/bin/chmod -R 700 /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
/usr/sbin/chown "$u" /Users/"$u"/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
done
## Create Launch Agent
/bin/echo '<?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>Disabled</key>
<false/>
<key>Label</key>
<string>com.MYCOMPANY.onedrive</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/OneDrive.app/Contents/MacOS/OneDrive</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
</dict>
</plist>' > "$launchAgent"
/usr/bin/chown root:wheel "$launchAgent"
/bin/chmod 644 "$launchAgent"
## Load as current user
theUser=$( python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");' )
if [[ $theUser ]]; then
theUID=$(id -u $theUser)
/bin/launchctl bootstrap gui/"$theUID" "$launchAgent"
## For pre 10.10 computers
if [[ $? -ne 0 ]]; then
/bin/launchctl asuser "$theUID" open "$theApp"
fi
fi
exit 0
Now I just need to get off my lazy arse and put these two keys into a Configuration Profile...
defaults write /Users/username/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist DisablePersonalSync -bool TRUE
defaults write /Users/username/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist Tenants '<dict><key>YourTenantIDvalue</key><dict><key>DefaultFolder</key><string>OneDrive - The Company Name</string></dict></dict>'
Posted on 05-31-2017 06:44 AM
Thanks @donmontalvo for sharing that script, that should be very helpful! One note...I think you missed a couple of identifying items in your script, but I must say I'm jealous! :)
Posted on 06-07-2017 01:11 PM
Also when you set the Tenants configuration and "OneDrive - Company" as the path, does this prevent the user from being able to change the location from ~/OneDrive - Company/? edoryu on the MacAdmins Slack #onedrive indicated that this was coming in the future, but I haven't yet seen anything indicating that is an absolute restriction that will prevent the user from creating their OD sync folder in ~/Desktop or something.
Posted on 09-19-2017 12:03 PM
This works great as a configuration policy but you can still set personal one drive up via Office (add a place) does anyone know a why to shut that feature off.
Posted on 09-19-2017 12:29 PM
vvvv
Posted on 04-10-2018 05:57 AM
I want to make OneDrive open at login as everytime the app store version updates it disables this option. I followed the documentation on how to do this but it doesn't work any ideas why?
Posted on 12-27-2018 06:13 AM
All the comments above seem related to mounting the personal drive. What about mounting Sharepoint drives in OneDrive?
I can see that ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Application Support/OneDrive/settings/Business1 has a bunch of .ini files that seem to define this. I haven't messed with those yet.
These .plist files seem to also contain the info, but they get over-written by the app with what it thinks the correct state is:
~/Library/Group Containers/UBF8T346G9.OfficeOneDriveSyncIntegration/Library/Preferences/UBF8T346G9.OfficeOneDriveSyncIntegration.plist
~/Library/Group Containers/UBF8T346G9.OneDriveSyncClientSuite/Library/Preferences/UBF8T346G9.OneDriveSyncClientSuite.plist
Posted on 06-09-2020 01:03 PM
Hi Guys, need bit of help on configuring one drive Mac OS mass deployment, having issue to set default folder for each user
here is plist i am working on ,some of setting are working like upload speed, bandwidth control.
<dict> <key>HideDockIcon</key> <false/> <key>DownloadBandwidthLimited</key> <integer>190</integer> <key>Disablepersonalaccounts</key> <false/> <key>BlockExternalSync</key> <false/> <key>UploadBandwidthLimited</key> <integer>200</integer> <key>OpenAtLogin</key> <true/> <key>DefaultFolder</key> <array> <dict> <key>TenantID</key> <string>TenantID</string> <key>Path</key> <string>file:///$HOME/Desktop</string>
Posted on 06-09-2020 01:03 PM
@dan-snelson Need bit of help , I am trying to configure plist of one drive with customised values , one is reading values like upload speed limit/bandwidth control but issue I am having to set default folder path ,it is not picking up value from plist .Any suggestions
Posted on 06-09-2020 01:14 PM
@davinder.singh If you run your script via Terminal as root
, I suspect you'll observe the following …
root# echo $HOME
/var/root
… since the Jamf binary executes scripts as root
.
The following may prove helpful:
loggedInUser=$( /bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ && ! /loginwindow/ { print $3 }' )
loggedInUserHome=$( /usr/bin/dscl . -read /Users/${loggedInUser} | /usr/bin/grep NFSHomeDirectory: | /usr/bin/cut -c 19- | /usr/bin/head -n 1 )
<key>Path</key> <string>file:///${loggedInUserHome}/Desktop</string>
Posted on 12-16-2020 06:03 AM
@davinder.singh @dan-snelson I would like to be sure about the logic of AutomaticUploadBandwidthPercentage
Does the percentage of bandwidth out of the total available (number to set in the prefs/conf. profile) refer to the total (available) bandwidth not in use?
Many thanks!
Posted on 12-16-2020 06:54 AM
@carlo.anselmi Excellent question for the likes of @pbowden.
Posted on 01-14-2021 01:31 PM
Hello everyone and @dan-snelson I am trying to create a config profile with iMazing Profile Editor to set AutomaticUploadBandwidthPercentage and despite it works perfectly if manually installed, it fails when pushed once loaded and scoped with JSS
<!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>AutomaticUploadBandwidthPercentage</key>
<integer>99</integer>
<key>DisablePersonalSync</key>
<false/>
<key>PayloadDisplayName</key>
<string>Microsoft OneDrive</string>
<key>PayloadIdentifier</key>
<string>com.microsoft.OneDrive</string>
<key>PayloadType</key>
<string>com.microsoft.OneDrive</string>
<key>PayloadUUID</key>
<string>3CAE1919-7840-48CA-99DE-18FD3F3D1F72</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>OneDrive Automatic Bandwith</string>
<key>PayloadDisplayName</key>
<string>OneDrive Automatic Bandwith</string>
<key>PayloadIdentifier</key>
<string>iMac.864C702B-EEDE-4CA0-BED5-27C0C6635EDE</string>
<key>PayloadOrganization</key>
<string>MyOrg</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>F732705C-6F79-40A5-979B-993ACA557252</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
What am I doing wrong?
Many thanks!
Carlo
Here below the result on stand alone client, manually installed, set to automatic adjust
Posted on 01-14-2021 02:13 PM
@carlo.anselmi Have you tried distributing a signed Configuration Profile via Jamf Pro?
/usr/bin/security cms -S -N "[Signing Certificate]" -i "[input]" -o "[output]"
Posted on 01-18-2021 08:56 AM
@dan-snelson Many thanks that solved the issue!
Cheers
Carlo
Posted on 05-11-2021 05:04 AM
Hey folks, I am trying to disable personal sync and from this thread I built the following script. The script seems to work, and it inserts the line, but then it appears that the plist gets overwritten again by OneDrive, and it is removed.
Any help here would be appreciated.
killall OneDrive
loggedInUser=$(stat -f%Su /dev/console)
/usr/bin/defaults write /Users/$loggedInUser/Library/Preferences/com.microsoft.OneDrive.plist DisablePersonalSync -bool True
/usr/sbin/chown $loggedInUser /Users/$loggedInUser/Library/Preferences/com.microsoft.OneDrive.plist
sleep 10
open -a OneDrive
Posted on 05-11-2021 07:49 AM
@rb_ if you want to set a preference so it can't be changed you're better off doing it with a config profile. see @carlo.anselmi 's post above for a good example
Posted on 12-02-2022 01:38 AM
Hi all,
I'm trying to limit the bandwidth that upload uses for download and upload, I saw that this can be done by adding 2 keys (UploadBandwidthLimited and DownloadBandwidthLimited) to the com.microsoft.ondrive.plist file. is this correct? If in case this is correct, is there a way to do this through a script?