Skip to main content
Question

Removing Office 2011

  • September 19, 2013
  • 40 replies
  • 75 views

Show first post

40 replies

Forum|alt.badge.img+20
  • Contributor
  • September 23, 2017

@talkingmoose talk do I need to still keep line 435 to key="$4" ?


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • September 23, 2017

@tcandela, only the changes I mentioned above. Leave line 435 as-is.


Forum|alt.badge.img+20
  • Contributor
  • September 25, 2017

@talkingmoose hey, I made those 4 changes to the script

kept line 435 to key="$1"

"Parameter 4" label under the Options tab to something like Additional Parameter (no quotes)
Additional Parameter 1 field to --Force (no quotes)

left all the $HOME alone for now in the script

testing soon


Forum|alt.badge.img+20
  • Contributor
  • September 25, 2017

@talkingmoose hey, 'moose' it worked. results of the script are below.

what i'm trying to do now is 'clean the dock' of any Office 2011 dock items that the user might have added to their dock. In the Script i see the function that does this removal, but the code in this function is based on using DOCKUTIL

these computers do not have DOCKUTIL installed, so i'm trying to adjust the ELSE clause to specifically go into the dock and remove any office 2011 items. The CleanDock function is below.

i understand the dock.plist for each user is in Dock preferences are in ~/Library/Preferences/com.apple.dock.plist
would just a refresh of the users Dock eliminate any Office 2011 dock items? I might put this Office 2011 uninstall in Self Service for the person to run it.

function CleanDock { LogMessage "In function 'CleanDock'" FormattedConsoleMessage "%-55s" "Cleaning icons in dock" if [ -e "$WORKING_FOLDER/dockutil" ]; then LogMessage "Found DockUtil tool" sudo "$WORKING_FOLDER"/dockutil --remove "file:///Applications/Microsoft%20Office%202011/Microsoft%20Document%20Connection.app/" --no-restart sudo "$WORKING_FOLDER"/dockutil --remove "file:///Applications/Microsoft%20Office%202011/Microsoft%20Word.app/" --no-restart sudo "$WORKING_FOLDER"/dockutil --remove "file:///Applications/Microsoft%20Office%202011/Microsoft%20Excel.app/" --no-restart sudo "$WORKING_FOLDER"/dockutil --remove "file:///Applications/Microsoft%20Office%202011/Microsoft%20PowerPoint.app/" --no-restart sudo "$WORKING_FOLDER"/dockutil --remove "file:///Applications/Microsoft%20Office%202011/Microsoft%20Outlook.app/" LogMessage "Completed dock clean-up" ConsoleMessage "${TEXT_GREEN}Success${TEXT_NORMAL}" else ConsoleMessage "${TEXT_YELLOW}Not detected${TEXT_NORMAL}" fi }
Running script Uninstall Office 2011.sh... Script exit code: 0 Script result: [0;34m=== Microsoft Office 2011 for Mac Removal Tool 1.3 ===[0m Removing Office 2011 Applications [0;32mSuccess[0m Removing Launch Daemon: Licensing Helper [0;32mSuccess[0m Removing Helper Tools: Licensing Helper [0;32mSuccess[0m Removing Office Fonts [0;32mSuccess[0m Removing Product License [0;32mSuccess[0m Removing Error Reporting [0;32mSuccess[0m Removing Application Support [0;32mSuccess[0m Removing Browser Font Cache [0;33mNot detected[0m Removing Setup Assistant Cache [0;33mNot detected[0m Removing Office Cache [0;32mSuccess[0m Removing Outlook Identity Cache [0;33mNot detected[0m Removing Outlook Cache [0;33mNot detected[0m Removing Preferences [0;32mSuccess[0m Preserving Outlook Identities and Databases [0;32mSuccess[0m Preserving Outlook Saved Attachments [0;33mNot detected[0m Preserving Outlook Sound Sets [0;33mNot detected[0m Removing Package Receipts [0;32mSuccess[0m Cleaning icons in dock [0;33mNot detected[0m Restarting Preferences Daemon [0;32mSuccess[0m All events and errors were logged to /var/folders/4r/9z7hv6t9571_9cwj2dpt57z40000gn/T/Uninstall Office 2011.sh.log

Forum|alt.badge.img+4
  • Contributor
  • September 25, 2017

This script (Remove2011) asks a few questions at the beginning. How to I set it up so that the answers are predetermined so there's no user interaction?


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • September 26, 2017

@tcandela, I suggest simply using dockutil. It's good. It's simple and it works well. It can remove a dock icon from all user home folders as well as the User Template. Just deploy it along with the script.


Forum|alt.badge.img+20
  • Contributor
  • October 3, 2017

@talkingmoose I just ran the script again and noticed it does not remove the following folder

/library/application support/microsoft/mau2.0 /library/application support/microsoft

so i had to do it manually

I want auto updates removed because i have office 2016 updates run through casper policies

checking the script to see where i can add this

should i add this to the main loop in the following section

Remove Office 2011 application support --

RemoveComponent "/Library/Application Support/Microsoft/MAU2.0" "Auto Update"


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • October 3, 2017

@tcandela, you'll have to add that to the script yourself.

The script was written to remove Office 2011 but it and Office 2016 share the Microsoft AutoUpdate (MAU) tool. Therefore, the script doesn't delete what may have been installed by Office 2016.

Rather than remove MAU using this script, you may want to create another smaller script that does just this and run it separately on machines where you find it's installed.


Forum|alt.badge.img+20
  • Contributor
  • October 3, 2017

@talkingmoose I just added

RemoveComponent "/Library/Application Support/Microsoft/MAU2.0" "Auto Update"
RemoveComponent "/Library/Application Support/Microsoft" "Microsoft App Support Folder"

should do it, testing soon

so now that section looks like this

# Remove Office 2011 application support RemoveComponent "/Library/Application Support/Microsoft/MERP2.0" "Error Reporting" RemoveComponent "/Library/Application Support/Microsoft/MAU2.0" "Auto Update" RemoveComponent "$HOME/Library/Application Support/Microsoft/Office" "Application Support" RemoveComponent "/Library/Application Support/Microsoft" "Microsoft App Support Folder"

Forum|alt.badge.img+20
  • Contributor
  • October 3, 2017

@talkingmoose hey, it works, I could have probable just did this single line, removing MERP2.0 & MAU2.0

RemoveComponent "/Library/Application Support/Microsoft" "Microsoft App Support Folder"

what is this following line? --> RemoveComponent "$HOME/Library/Application Support/Microsoft/Office" "Application Support"

I am confused about $HOME --> where is this referring to ?


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • October 3, 2017

@tcandela, most any word you see in a shell script like this that begins with $ means it's a variable — a placeholder for another piece of information.

In this case, if you run echo $HOME in Terminal, you'll see it returns the path to your own home folder. If my username is mmoose then $HOME means /Users/mmoose.

And if you see something like $HOME/Library/Preferences/com.mircrosoft.Word.plist then that expands to /Users/mmoose/Library/Preferences/com.mircrosoft.Word.plist.

Keep in mind that $HOME is relative to whoever is logged in and running the script.


Forum|alt.badge.img+15
  • Contributor
  • October 10, 2017

@talkingmoose - dumb question but I figure you can answer it quickly. When you said above

@tcandela, I suggest simply using dockutil. It's good. It's simple and it works well. It can remove a dock icon from all user home folders as well as the User Template. Just deploy it along with the script.

Do you mean add the dockutil script to the policy along with the modified Remove2011 script? When I do that, the policy returns with an error because dockutil tries to run and doesn't have any arguments supplied. How exactly do you suggest "deploying it along with the script?"

Thanks!


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • October 12, 2017

@sag969, Dockutil is meant to be deployed to systems and reside there for other scripts to call. Wherever you decide to put it, you'll need to update the path in @pbowden's script to point to Dockutil.

Looks like his script declares a variable near the top:

WORKING_FOLDER=$(dirname "$0")

This appears to only be for describing where Dockutil lives on the Mac. You should be able to set this to something like:

WORKING_FOLDER="/private/tmp"

Then, package the Dockutil tool using Composer and deploy it to the /private/tmp folder. I know some administrators like to keep Dockutil on all their Macs for future use. You want want to instead deploy it permanently to a place like "/Library/Company Name/Scripts" and call it from there.

I haven't tested this, but from what I see in the script, it should work this way.


Forum|alt.badge.img+12
  • Valued Contributor
  • October 12, 2017

@talkingmoose @sag969 Just a word of caution that you should use the version of Dockutil that I supply with the Remove2011 script at https://github.com/pbowden-msft/Remove2011 as it contains a couple of tweaks of Kyle's base version, that has better handling for icon removal of Office apps.


Forum|alt.badge.img+14
  • Valued Contributor
  • May 14, 2018

So, I'm trying to use Paul's script and have two questions...

  1. Can I just paste this into Jamf and run as a script or do I need to make some adjustments? I'm not an expert on scripting but noticed $1 and $2 and am wondering if I need to change those lines to something like $4 and $5? Above someone mentioned changing $1 to $4 on specific line but the script I'm looking at doesn't have that on that line number and there's more than one.

  2. I haven't had luck with dockutil removing items when the path is in there like it is. It says it's not found. Anybody else have this work or do I need to go in and edit the script to use the dock icon names?

Sorry for digging up an old thread but it seems to apply.