OneDrive for Business Default Folder Location

New Contributor II

Hi all!

Has anyone out there managed to script the location of the OneDrive for Business folder for users?

I've tried to follow the MS documentation here. Specifically the following lines of code:

/usr/libexec/PlistBuddy -c "Add :Tenants:my_tenant_id" ~/Library/Containers/
/usr/libexec/PlistBuddy -c "Add :Tenants:my_tenant_id:DefaultFolder string '<PathToFolder>'" ~/Library/Containers/

I'm not having any luck running those. The first command spits out "Unrecognized Type:".

Any thoughts out there?




I was just looking into this the other day.
Looking at talks about "This setting is configured using a nested dictionary in the preferences plist for The outer dictionary ("Tenants") contains key/value pairs of tenant IDs (the key), and a dictionary of specific settings for that tenant (the value):" Notice it says "the outer DICT..."
Below is the command I tried, which kind of worked. At least it put the entry into the plist file without any errors. But when I test it out OneDrive, the setup wizard, still ask me choose a location for the OneDrive folder. :(

/usr/libexec/PlistBuddy -c "Add :Tenants:xxx-xxx-xxxx-xxxxxxx-xxx dict" ~/Library/Containers/
*This is all one line. Of course you need to replace xxx-xxx with your GUID.

The 2nd command seems to go into the plist without any problems.

Maybe this will help you out. If you get it to work, let me know.

New Contributor II

I've managed to get the commands working, and the plist now looks as it should - thanks for your help there.

But like you, those settings in the plist don't seem to do anything, I still get prompted for the OneDrive location.

Any one out there have any luck with this?

New Contributor

Not me.

Tried it with the latest client as we want to standardise where the ODfB folder lives.

The setup still doesn't skip the 'This is your OneDrive folder' page.

Annoying that the actual plistbuddy command is still wrong in the documentation too.

Contributor II

Has anyone had any luck with setting the default OneDrive location?


Hey sorry to resurrect an old thread, but wanted to chime in I also tried to accomplish Microsoft's process to set a default folder for OneDrive and also had no success getting said preference to set. Can I ask: has anyone had luck with this in the last few months or come up with any workarounds? Also (if I may ask) what default folder location are you trying to set...and how are you typing this out in the plistbuddy command? Then after the preference domain is configured correctly, are you uploading the plist into a custom profile payload and using User or Computer level settings in the JSS?


Valued Contributor

There are regular conversations around this on the #onedrive channel of the MacAdmins Slack.

If you're not yet on there, you can sign up via

Esteemed Contributor III

In case you're deploying the OneDrive stand alone package, Microsoft has a KB on these settings.