Skip to content

Instantly share code, notes, and snippets.

@soundsnw
Created July 18, 2019 21:08
Show Gist options
  • Save soundsnw/8ab1e94fa68b88696de5c453d629b92b to your computer and use it in GitHub Desktop.
Save soundsnw/8ab1e94fa68b88696de5c453d629b92b to your computer and use it in GitHub Desktop.
approve-mau-daemon.sh
#!/bin/bash
# Pre-approve the popup that asks the user to approve running the MAU daemon
# Get the logged in user
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
# Register MAU
/usr/bin/sudo -u $loggedInUser /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app"
/usr/bin/sudo -u $loggedInUser /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment