Skip to main content

So, I'm not much of a writer, so I'll be quick with this.

Here is the code:

#!/bin/sh

#Find Current User
CurrentUser=`/usr/bin/who | awk '/console/{ print $1 }'`

#Set Command Variable for trusted application
register_trusted_cmd="/usr/bin/sudo -u $CurrentUser /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted"

#Set Variable for application being run against
application="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"

#This runs the combination of variables above that will block the running
#of the autoupdate.app until the user actually clicks on it, or goes
#into the help check for updates menu.  Additionally this needs to be
#run for each user on a machine.
$register_trusted_cmd "$application"

#Ungracefully removes Office 2011
/bin/rm -rf /Applications/Microsoft Office 2011/

#Turns off the FirstRunScreen for each application.
/usr/bin/defaults write /Library/Preferences/com.microsoft.Outlook kSubUIAppCompletedFirstRunSetup1507 -bool true
/usr/bin/defaults write /Library/Preferences/com.microsoft.PowerPoint kSubUIAppCompletedFirstRunSetup1507 -bool true
/usr/bin/defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true
/usr/bin/defaults write /Library/Preferences/com.microsoft.Word kSubUIAppCompletedFirstRunSetup1507 -bool true

exit 0

Thanks to @tvsutton for his assistance for on this.

@franton thanks for your clear explanation works great . Question: How do you deal with dock items? We now have office2010 in the dock for removal , we use dockutil of " kcrawford Github " and also adding of 2016. But we see that we need to repeat the command 3 times before it works.
How do you deal with it?

#!/bin/sh
Before installation:
# Remove Office dock items end user.
$dockutil --remove "Microsoft Word" --allhomes --no-restart
killall Dock
$dockutil --remove "Microsoft Excel" --allhomes --no-restart
killall Dock
$dockutil --remove "Microsoft Outlook" --allhomes --no-restart
killall Dock
$dockutil --remove "Microsoft PowerPoint" --allhomes --no-restart
killall Dock
$dockutil --remove "Microsoft OneNote" --allhomes --no-restart

killall cfprefsd
killall Dock
#!/bin/sh
After installation:
# Add Office Dock to end user 3 times.
echo "Add/Replace Office dock items"

$dockutil --add '/Applications/Microsoft Word.app' --replacing 'Microsoft Word' --allhomes --no-restart $plist
killall Dock
$dockutil --add '/Applications/Microsoft Excel.app' --replacing 'Microsoft Excel' --allhomes --no-restart $plist
killall Dock
$dockutil --add '/Applications/Microsoft Outlook.app' --replacing 'Microsoft Outlook' --allhomes --no-restart $plist
killall Dock
$dockutil --add '/Applications/Microsoft PowerPoint.app' --replacing 'Microsoft PowerPoint' --allhomes --no-restart $plist
killall Dock
$dockutil --add '/Applications/Microsoft OneNote.app' --allhomes --no-restart $plist
killall Dock

echo "Refresh Dock"
killall cfprefsd
killall Dock

It would be nice if MS included a command line component to AutoUpdate so we could kick off updates in the background via ARD after we've evaluated the updates on test Macs first.


@mvught You have to run only once if you follow these steps:
1) Don't use "--no-restart"
2) add a "sleep x" in between commands

My working script to replace Office 2011 from dock

# Dock Icons change - for current user and all existing users on this computer
/usr/local/bin/dockutil --add '/Applications/Microsoft Word.app' --replacing 'Microsoft Word' --allhomes
/bin/sleep 10
/usr/local/bin/dockutil --add '/Applications/Microsoft Excel.app' --replacing 'Microsoft Excel' --allhomes
/bin/sleep 10
/usr/local/bin/dockutil --add '/Applications/Microsoft PowerPoint.app' --replacing 'Microsoft PowerPoint' --allhomes

@Kumarasinghe Thank you so much, works like a charm


I'm trying to distribute Office 2016 across our Enterprise. When Office is installed locally you see a Sign In option only. When Office is installed using any Application Distribution software and our Serializer you get the option of Skip sign in (See attached .jpg).

Is there a method to install a .plist file or run a script that will prevent this option to "Sign In" all together? What .plist file needs modification? Thanks so much for any help!


@MacGeek There are 2 versions of Office 2016.

  1. Office 365 Version which requires sign in option to activate
  2. the VL + Serializer Version which you have to deploy after to get the "skip sign in"

There are a few pages on JAMFNATION that will show u how to avoid the sign in, but I have not tried them. Once u have serialized the install, the sign in pop up will be gone.


Ok, must be that I am a shell script newbie, but how to you run this script? Google really doesn't help me on this but hopefully a kind soul here will.

Thanks in advance
Cheers