Home > Mac administration, Office 2016, Scripting > Office 2016 DefaultsToLocalOpenSave setting change as of Office 2016 15.33.x

Office 2016 DefaultsToLocalOpenSave setting change as of Office 2016 15.33.x

As part of the release of Office 2016 15.33.0, a number of managed preference options have been added and some have changed from what they were before. An example of one that has changed is the DefaultsToLocalOpenSave management setting, which sets the Open and Save options in Office 2016 apps to default to On My Mac instead of Online Locations.

In Microsoft Office 2016 15.32.x and earlier, the  DefaultsToLocalOpenSave setting could only be managed by running a command similar to the one below on the individual user accounts:

/usr/bin/defaults write "/path/to/user/homefolder/Library/Group Containers/UBF8T346G9.Office/"com.microsoft.officeprefs DefaultsToLocalOpenSave -bool true

To set this for all accounts on a particular Mac, I had written the following script:


#!/bin/bash
# Set the Open and Save options in Office 2016 apps to default to
# "On My Mac" instead of "Online Locations" in the default user template
for USER_TEMPLATE in "/System/Library/User Template"/*
do
/usr/bin/defaults write "${USER_TEMPLATE}/Library/Group Containers/UBF8T346G9.Office/"com.microsoft.officeprefs DefaultsToLocalOpenSave -bool true
done
# Set the Open and Save options in Office 2016 apps to default to
# "On My Mac" instead of "Online Locations" in the user folders
# located in /Users, then fixes the permissions on the affected
# file so that the file is owned by the user folder's owner rather
# than being owned by root.
for USER_HOME in /Users/*
do
USER_UID=`basename "${USER_HOME}"`
if [ ! "${USER_UID}" = "Shared" ]; then
if [ ! -d "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office" ]; then
/bin/mkdir -p "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office"
/usr/sbin/chown "${USER_UID}" "${USER_HOME}/Library"
/usr/sbin/chown "${USER_UID}" "${USER_HOME}/Library/Group Containers"
/usr/sbin/chown "${USER_UID}" "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office"
fi
if [ -d "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office" ]; then
/usr/bin/defaults write "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office/"com.microsoft.officeprefs DefaultsToLocalOpenSave -bool true
/usr/sbin/chown "${USER_UID}" "${USER_HOME}/Library/Group Containers/UBF8T346G9.Office/"com.microsoft.officeprefs.plist
fi
fi
done

view raw

gistfile1.txt

hosted with ❤ by GitHub

As of Microsoft Office 2016 15.33.x, this setting can now be set at the global level for all users by running the following command with root privileges:

/usr/bin/defaults write /Library/Preferences/com.microsoft.office DefaultsToLocalOpenSave -bool true

I’ve posted an updated script for manage this setting to GitHub, available via the link below:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/set_office_2016_default_save_option_to_on_my_mac

This setting can now also be managed with a profile, so I’ve created a .mobileconfig file and posted it here on Github:

https://github.com/rtrouton/profiles/tree/master/Office2016DefaultToLocalSave

  1. lunddal
    April 18, 2017 at 12:09 pm

    Doesn’t seem to change anything for me. It still defaults to OneDrive or SharePoint.

  2. scheblein
    September 6, 2019 at 5:51 pm

    Any way to enforce cloud save (onedrive/sharepoint)?

  3. Melissa
    June 3, 2020 at 8:11 pm

    Many, many thanks for this! Used sudo in Terminal to solve my problem in Excel 2019.

  4. jk
    June 26, 2021 at 9:11 pm

    The
    /usr/bin/defaults write /Library/Preferences/com.microsoft.office DefaultsToLocalOpenSave -bool true

    commend worked well – being on Office 2019. Only drawback remains is the showing of “Online Locations” and the option to open ‘Original’, ‘Repair’ or ‘Recover text’ – all but ‘Original’ I hope never having to use … pity that I have no idea to get rid of this further MS-nonsense.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: