Skip to content

Instantly share code, notes, and snippets.

@samson-sham
Last active May 6, 2022 05:57
Show Gist options
  • Save samson-sham/74803a93b72eb896e5a7f4a6ef46215d to your computer and use it in GitHub Desktop.
Save samson-sham/74803a93b72eb896e5a7f4a6ef46215d to your computer and use it in GitHub Desktop.
stop microsoft autoupdate
$ plutil -p /Library/LaunchAgents/com.microsoft.update.agent.plist ~
{
"Disabled" => 0
"Label" => "com.microsoft.update.agent"
"MachServices" => {
"com.microsoft.update.xpc" => 1
}
"ProgramArguments" => [
0 => "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft Update Assistant.app/Contents/MacOS/Microsoft Update Assistant"
1 => "--launchByAgent"
]
"RunAtLoad" => 1
"StartInterval" => 7200
}
$ plutil -p /Library/LaunchAgents/com.microsoft.OneDriveStandaloneUpdater.plist ~
{
"Label" => "com.microsoft.OneDriveStandaloneUpdater"
"Program" => "/Applications/OneDrive.app/Contents/StandaloneUpdater.app/Contents/MacOS/OneDriveStandaloneUpdater"
"ProgramArguments" => [
]
"RunAtLoad" => 1
"StartInterval" => 86400
}
sudo plutil -replace Disabled -integer 1 /Library/LaunchAgents/com.microsoft.update.agent.plist
sudo plutil -replace RunAtLoad -integer 0 /Library/LaunchAgents/com.microsoft.update.agent.plist
sudo plutil -replace RunAtLoad -integer 0 /Library/LaunchAgents/com.microsoft.OneDriveStandaloneUpdater.plist
# https://superuser.com/questions/1544338/turn-off-microsoft-apps-microsoft-autoupdate-app-on-a-mac
# disable the service
launchctl disable gui/$(id -u)/com.microsoft.update.agent
# check that the service is disabled
launchctl print-disabled gui/$(id -u) | grep microsoft
### Change interval instead of disable ###
# check current config content
plutil -p /Library/LaunchAgents/com.microsoft.update.agent.plist
# backup
cp -a /Library/LaunchAgents/com.microsoft.update.agent.plist /somewhere/to/backup/
# update the interval, e.g. 43200 seconds (i.e. 12 hours)
sudo plutil -replace StartInterval -integer 43200 /Library/LaunchAgents/com.microsoft.update.agent.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment