Skip to content

Instantly share code, notes, and snippets.

@neilmartin83
Last active January 10, 2017 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilmartin83/4e704a0c627453ca216d413c2ae43182 to your computer and use it in GitHub Desktop.
Save neilmartin83/4e704a0c627453ca216d413c2ae43182 to your computer and use it in GitHub Desktop.
#!/bin/sh
loggedInUser=`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 + "\n");'`
su - "$loggedInUser" -c '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted -v "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app"'
su - "$loggedInUser" -c '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted -v "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"'
su - "$loggedInUser" -c 'defaults delete com.microsoft.autoupdate2 LastUpdate'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment