├── MSUpdateHelper4JamfPro.sh ├── MSUpdateTrigger.sh └── README.md /MSUpdateHelper4JamfPro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Microsoft AutoUpdate Helper for Jamf Pro 4 | # Script Version 1.5 5 | # 6 | ## Copyright (c) 2022 Microsoft Corp. All rights reserved. 7 | ## Scripts are not supported under any Microsoft standard support program or service. The scripts are provided AS IS without warranty of any kind. 8 | ## Microsoft disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a 9 | ## particular purpose. The entire risk arising out of the use or performance of the scripts and documentation remains with you. In no event shall 10 | ## Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever 11 | ## (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary 12 | ## loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility 13 | ## of such damages. 14 | ## Feedback: pbowden@microsoft.com 15 | 16 | # IT Admin constants for which applications to update [set to true or false as required] 17 | UPDATE_WORD="true" 18 | UPDATE_EXCEL="true" 19 | UPDATE_POWERPOINT="true" 20 | UPDATE_OUTLOOK="true" 21 | UPDATE_ONENOTE="true" 22 | UPDATE_SKYPEBUSINESS="true" 23 | UPDATE_REMOTEDESKTOP="true" 24 | UPDATE_COMPANYPORTAL="true" 25 | 26 | # IT Admin constants for application target version [set to "latest" to get latest update, or specific build number, such as "15.41.17120500"] 27 | VERSION_WORD="latest" 28 | VERSION_EXCEL="latest" 29 | VERSION_POWERPOINT="latest" 30 | VERSION_OUTLOOK="latest" 31 | VERSION_ONENOTE="latest" 32 | VERSION_SKYPEBUSINESS="latest" 33 | VERSION_REMOTEDESKTOP="latest" 34 | VERSION_COMPANYPORTAL="latest" 35 | 36 | # IT Admin constants for application path 37 | PATH_WORD="/Applications/Microsoft Word.app" 38 | PATH_EXCEL="/Applications/Microsoft Excel.app" 39 | PATH_POWERPOINT="/Applications/Microsoft PowerPoint.app" 40 | PATH_OUTLOOK="/Applications/Microsoft Outlook.app" 41 | PATH_ONENOTE="/Applications/Microsoft OneNote.app" 42 | PATH_SKYPEBUSINESS="/Applications/Skype for Business.app" 43 | PATH_REMOTEDESKTOP="/Applications/Microsoft Remote Desktop.app" 44 | PATH_COMPANYPORTAL="/Applications/Company Portal.app" 45 | 46 | # Function to enable debug logging 47 | function Debug() { 48 | if [ "$OVERRIDE_DEBUG" == "true" ] || [ "$OVERRIDE_DEBUG" == "TRUE" ] || [ "$OVERRIDE_DEBUG" == "True" ] || [ "$OVERRIDE_DEBUG" == "YES" ] || [ "$OVERRIDE_DEBUG" == "yes" ] || [ "$OVERRIDE_DEBUG" == "Yes" ]; then 49 | LOG=$(date; echo "$1") 50 | echo "$LOG" 51 | fi 52 | } 53 | 54 | # Harvest script parameter overrides 55 | OVERRIDE_DEBUG="$4" 56 | OVERRIDE_WORD="$5" 57 | Debug "OVERRIDE_WORD: $5" 58 | OVERRIDE_EXCEL="$6" 59 | Debug "OVERRIDE_EXCEL: $6" 60 | OVERRIDE_POWERPOINT="$7" 61 | Debug "OVERRIDE_POWERPOINT: $7" 62 | OVERRIDE_OUTLOOK="$8" 63 | Debug "OVERRIDE_OUTLOOK: $8" 64 | OVERRIDE_SKYPEBUSINESS="$9" 65 | Debug "OVERRIDE_SKYPEBUSINESS: $9" 66 | OVERRIDE_ONENOTE="${10}" 67 | Debug "OVERRIDE_ONENOTE: ${10}" 68 | OVERRIDE_REMOTEDESKTOP="${11}" 69 | Debug "OVERRIDE_REMOTEDESKTOP: ${11}" 70 | 71 | # Function to evaluate app update override 72 | function GetUpdateOverride() { 73 | if [ ! "$1" = "" ]; then 74 | local UPDATE_FIELD1=$(echo "$1" | cut -d '@' -f1) 75 | if [ "$UPDATE_FIELD1" == "TRUE" ] || [ "$UPDATE_FIELD1" == "true" ] || [ "$UPDATE_FIELD1" == "True" ] || [ "$UPDATE_FIELD1" == "YES" ] || [ "$UPDATE_FIELD1" == "yes" ] || [ "$UPDATE_FIELD1" == "Yes" ]; then 76 | echo "true" 77 | elif [ "$UPDATE_FIELD1" == "FALSE" ] || [ "$UPDATE_FIELD1" == "false" ] || [ "$UPDATE_FIELD1" == "False" ] || [ "$UPDATE_FIELD1" == "NO" ] || [ "$UPDATE_FIELD1" == "no" ] || [ "$UPDATE_FIELD1" == "No" ]; then 78 | echo "false" 79 | fi 80 | else 81 | echo "$2" 82 | fi 83 | } 84 | 85 | # Function to evaluate app version override 86 | function GetVersionOverride() { 87 | if [ ! "$1" = "" ]; then 88 | local UPDATE_FIELD2=$(echo "$1" | cut -d '@' -f2) 89 | if [ "$UPDATE_FIELD2" == "TRUE" ] || [ "$UPDATE_FIELD2" == "true" ] || [ "$UPDATE_FIELD2" == "True" ] || [ "$UPDATE_FIELD2" == "YES" ] || [ "$UPDATE_FIELD2" == "yes" ] || [ "$UPDATE_FIELD2" == "Yes" ] || [ "$UPDATE_FIELD2" == "FALSE" ] || [ "$UPDATE_FIELD2" == "false" ] || [ "$UPDATE_FIELD2" == "False" ] || [ "$UPDATE_FIELD2" == "NO" ] || [ "$UPDATE_FIELD2" == "no" ] || [ "$UPDATE_FIELD2" == "No" ] ; then 90 | echo "$2" 91 | else 92 | echo "$UPDATE_FIELD2" 93 | fi 94 | else 95 | echo "$2" 96 | fi 97 | } 98 | 99 | # Function to parse script parameter overrides 100 | function GetOverrides() { 101 | UPDATE_WORD=$(GetUpdateOverride "$OVERRIDE_WORD" "$UPDATE_WORD") 102 | Debug "Resolved UPDATE_WORD: $UPDATE_WORD" 103 | VERSION_WORD=$(GetVersionOverride "$OVERRIDE_WORD" "$VERSION_WORD") 104 | Debug "Resolved VERSION_WORD: $VERSION_WORD" 105 | 106 | UPDATE_EXCEL=$(GetUpdateOverride "$OVERRIDE_EXCEL" "$UPDATE_EXCEL") 107 | Debug "Resolved UPDATE_EXCEL: $UPDATE_EXCEL" 108 | VERSION_EXCEL=$(GetVersionOverride "$OVERRIDE_EXCEL" "$VERSION_EXCEL") 109 | Debug "Resolved VERSION_EXCEL: $VERSION_EXCEL" 110 | 111 | UPDATE_POWERPOINT=$(GetUpdateOverride "$OVERRIDE_POWERPOINT" "$UPDATE_POWERPOINT") 112 | Debug "Resolved UPDATE_POWERPOINT: $UPDATE_POWERPOINT" 113 | VERSION_POWERPOINT=$(GetVersionOverride "$OVERRIDE_POWERPOINT" "$VERSION_POWERPOINT") 114 | Debug "Resolved VERSION_POWERPOINT: $VERSION_POWERPOINT" 115 | 116 | UPDATE_OUTLOOK=$(GetUpdateOverride "$OVERRIDE_OUTLOOK" "$UPDATE_OUTLOOK") 117 | Debug "Resolved UPDATE_OUTLOOK: $UPDATE_OUTLOOK" 118 | VERSION_OUTLOOK=$(GetVersionOverride "$OVERRIDE_OUTLOOK" "$VERSION_OUTLOOK") 119 | Debug "Resolved VERSION_OUTLOOK: $VERSION_OUTLOOK" 120 | 121 | UPDATE_SKYPEBUSINESS=$(GetUpdateOverride "$OVERRIDE_SKYPEBUSINESS" "$UPDATE_SKYPEBUSINESS") 122 | Debug "Resolved UPDATE_SKYPEBUSINESS: $UPDATE_SKYPEBUSINESS" 123 | VERSION_SKYPEBUSINESS=$(GetVersionOverride "$OVERRIDE_SKYPEBUSINESS" "$VERSION_SKYPEBUSINESS") 124 | Debug "Resolved VERSION_SKYPEBUSINESS: $VERSION_SKYPEBUSINESS" 125 | 126 | UPDATE_ONENOTE=$(GetUpdateOverride "$OVERRIDE_ONENOTE" "$UPDATE_ONENOTE") 127 | Debug "Resolved UPDATE_ONENOTE: $UPDATE_ONENOTE" 128 | VERSION_ONENOTE=$(GetVersionOverride "$OVERRIDE_ONENOTE" "$VERSION_ONENOTE") 129 | Debug "Resolved VERSION_ONENOTE: $VERSION_ONENOTE" 130 | 131 | UPDATE_REMOTEDESKTOP=$(GetUpdateOverride "$OVERRIDE_REMOTEDESKTOP" "$UPDATE_REMOTEDESKTOP") 132 | Debug "Resolved UPDATE_REMOTEDESKTOP: $UPDATE_REMOTEDESKTOP" 133 | VERSION_REMOTEDESKTOP=$(GetVersionOverride "$OVERRIDE_REMOTEDESKTOP" "$VERSION_REMOTEDESKTOP") 134 | Debug "Resolved VERSION_REMOTEDESKTOP: $VERSION_REMOTEDESKTOP" 135 | } 136 | 137 | # Function to check whether MAU 3.18 or later command-line updates are available 138 | function CheckMAUInstall() { 139 | if [ ! -e "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" ]; then 140 | echo "MAU 3.18 or later is required!" 141 | exit 1 142 | fi 143 | } 144 | 145 | # Function to check whether Office apps are installed 146 | function CheckAppInstall() { 147 | if [ ! -e "$PATH_WORD" ]; then 148 | Debug "Word is not installed" 149 | UPDATE_WORD="false" 150 | fi 151 | if [ ! -e "$PATH_EXCEL" ]; then 152 | Debug "Excel is not installed" 153 | UPDATE_EXCEL="false" 154 | fi 155 | if [ ! -e "$PATH_POWERPOINT" ]; then 156 | Debug "PowerPoint is not installed" 157 | UPDATE_POWERPOINT="false" 158 | fi 159 | if [ ! -e "$PATH_OUTLOOK" ]; then 160 | Debug "Outlook is not installed" 161 | UPDATE_OUTLOOK="false" 162 | fi 163 | if [ ! -e "$PATH_ONENOTE" ]; then 164 | Debug "OneNote is not installed" 165 | UPDATE_ONENOTE="false" 166 | fi 167 | if [ ! -e "$PATH_SKYPEBUSINESS" ]; then 168 | Debug "Skype for Business is not installed" 169 | UPDATE_SKYPEBUSINESS="false" 170 | fi 171 | if [ ! -e "$PATH_REMOTEDESKTOP" ]; then 172 | Debug "Remote Desktop is not installed" 173 | UPDATE_REMOTEDESKTOP="false" 174 | fi 175 | if [ ! -e "$PATH_COMPANYPORTAL" ]; then 176 | Debug "Company Portal is not installed" 177 | UPDATE_COMPANYPORTAL="false" 178 | fi 179 | } 180 | 181 | # Function to determine the logged-in state of the Mac 182 | function DetermineLoginState() { 183 | # The following line is is taken from: https://erikberglund.github.io/2018/Get-the-currently-logged-in-user,-in-Bash/ 184 | CONSOLE="$(/usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | /usr/bin/awk '/Name :/ && ! /loginwindow/ { print $3 }')" 185 | if [ "$CONSOLE" == "" ]; then 186 | echo "No user logged in" 187 | CMD_PREFIX="" 188 | else 189 | echo "User $CONSOLE is logged in" 190 | userID=$(/usr/bin/id -u "$CONSOLE") 191 | CMD_PREFIX="/bin/launchctl asuser $userID " 192 | fi 193 | Debug "Resolved CMD_PREFIX: $CMD_PREFIX" 194 | } 195 | 196 | # Function to set target version for app 197 | function SetTargetVersion() { 198 | if [ "$1" == "LATEST" ] || [ "$1" == "latest" ] || [ "$1" == "" ]; then 199 | TARGET_VERSION="" 200 | else 201 | TARGET_VERSION="--version ${1}" 202 | fi 203 | Debug "Final TARGET_VERSION: $TARGET_VERSION" 204 | } 205 | 206 | # Function to register an application with MAU 207 | function RegisterApp() { 208 | Debug "RegisterApp: Params - $1 $2" 209 | $(${CMD_PREFIX}defaults write com.microsoft.autoupdate2 Applications -dict-add "$1" "{ 'Application ID' = '$2'; LCID = 1033 ; }") 210 | } 211 | 212 | # Function to call 'msupdate' and update the target application 213 | function PerformUpdate() { 214 | Debug "PerformUpdate: ${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --install --apps $1 $2 --wait 600 2>/dev/null" 215 | ${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --install --apps $1 $2 --wait 600 2>/dev/null 216 | } 217 | 218 | ## MAIN 219 | CheckMAUInstall 220 | GetOverrides 221 | CheckAppInstall 222 | DetermineLoginState 223 | 224 | if [ "$UPDATE_WORD" == "true" ]; then 225 | Debug "Going for Word update" 226 | RegisterApp "$PATH_WORD" "MSWD15" 227 | SetTargetVersion "$VERSION_WORD" 228 | PerformUpdate "MSWD15" "$TARGET_VERSION" 229 | else 230 | Debug "Update for Word disabled" 231 | fi 232 | if [ "$UPDATE_EXCEL" == "true" ]; then 233 | Debug "Going for Excel update" 234 | RegisterApp "$PATH_EXCEL" "XCEL15" 235 | SetTargetVersion "$VERSION_EXCEL" 236 | PerformUpdate "XCEL15" "$TARGET_VERSION" 237 | else 238 | Debug "Update for Excel disabled" 239 | fi 240 | if [ "$UPDATE_POWERPOINT" == "true" ]; then 241 | Debug "Going for PowerPoint update" 242 | RegisterApp "$PATH_POWERPOINT" "PPT315" 243 | SetTargetVersion "$VERSION_POWERPOINT" 244 | PerformUpdate "PPT315" "$TARGET_VERSION" 245 | else 246 | Debug "Update for PowerPoint disabled" 247 | fi 248 | if [ "$UPDATE_OUTLOOK" == "true" ]; then 249 | Debug "Going for Outlook update" 250 | RegisterApp "$PATH_OUTLOOK" "OPIM15" 251 | SetTargetVersion "$VERSION_OUTLOOK" 252 | PerformUpdate "OPIM15" "$TARGET_VERSION" 253 | else 254 | Debug "Update for Outlook disabled" 255 | fi 256 | if [ "$UPDATE_ONENOTE" == "true" ]; then 257 | Debug "Going for OneNote update" 258 | RegisterApp "$PATH_ONENOTE" "ONMC15" 259 | SetTargetVersion "$VERSION_ONENOTE" 260 | PerformUpdate "ONMC15" "$TARGET_VERSION" 261 | else 262 | Debug "Update for OneNote disabled" 263 | fi 264 | if [ "$UPDATE_SKYPEBUSINESS" == "true" ]; then 265 | Debug "Going for SfB update" 266 | RegisterApp "$PATH_SKYPEBUSINESS" "MSFB16" 267 | SetTargetVersion "$VERSION_SKYPEBUSINESS" 268 | PerformUpdate "MSFB16" "$TARGET_VERSION" 269 | else 270 | Debug "Update for SfB disabled" 271 | fi 272 | if [ "$UPDATE_REMOTEDESKTOP" == "true" ]; then 273 | Debug "Going for Remote Desktop update" 274 | RegisterApp "$PATH_REMOTEDESKTOP" "MSRD10" 275 | SetTargetVersion "$VERSION_REMOTEDESKTOP" 276 | PerformUpdate "MSRD10" "$TARGET_VERSION" 277 | else 278 | Debug "Update for Remote Desktop disabled" 279 | fi 280 | if [ "$UPDATE_COMPANYPORTAL" == "true" ]; then 281 | Debug "Going for Company Portal update" 282 | RegisterApp "$PATH_COMPANYPORTAL" "IMCP01" 283 | SetTargetVersion "$VERSION_COMPANYPORTAL" 284 | PerformUpdate "IMCP01" "$TARGET_VERSION" 285 | else 286 | Debug "Update for Company Portal disabled" 287 | fi 288 | 289 | exit 0 290 | -------------------------------------------------------------------------------- /MSUpdateTrigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Microsoft AutoUpdate Trigger for Jamf Pro 4 | # Script Version 1.7 5 | # 6 | ## Copyright (c) 2020 Microsoft Corp. All rights reserved. 7 | ## Scripts are not supported under any Microsoft standard support program or service. The scripts are provided AS IS without warranty of any kind. 8 | ## Microsoft disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a 9 | ## particular purpose. The entire risk arising out of the use or performance of the scripts and documentation remains with you. In no event shall 10 | ## Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever 11 | ## (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary 12 | ## loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility 13 | ## of such damages. 14 | ## Feedback: pbowden@microsoft.com 15 | 16 | # IT Admin constants for application path 17 | PATH_WORD="/Applications/Microsoft Word.app" 18 | PATH_EXCEL="/Applications/Microsoft Excel.app" 19 | PATH_POWERPOINT="/Applications/Microsoft PowerPoint.app" 20 | PATH_OUTLOOK="/Applications/Microsoft Outlook.app" 21 | PATH_ONENOTE="/Applications/Microsoft OneNote.app" 22 | PATH_SKYPEBUSINESS="/Applications/Skype for Business.app" 23 | PATH_REMOTEDESKTOP="/Applications/Microsoft Remote Desktop.app" 24 | PATH_COMPANYPORTAL="/Applications/Company Portal.app" 25 | PATH_DEFENDER="/Applications/Microsoft Defender ATP.app" 26 | PATH_EDGE="/Applications/Microsoft Edge.app" 27 | PATH_TEAMS="/Applications/Microsoft Teams.app" 28 | PATH_ONEDRIVE="/Applications/OneDrive.app" 29 | 30 | APPID_WORD="MSWD2019" 31 | APPID_EXCEL="XCEL2019" 32 | APPID_POWERPOINT="PPT32019" 33 | APPID_OUTLOOK="OPIM2019" 34 | APPID_ONENOTE="ONMC2019" 35 | APPID_SKYPEBUSINESS="MSFB16" 36 | APPID_REMOTEDESKTOP="MSRD10" 37 | APPID_COMPANYPORTAL="IMCP01" 38 | APPID_DEFENDER="WDAV00" 39 | APPID_EDGE="EDGE01" 40 | APPID_TEAMS="TEAM01" 41 | APPID_ONEDRIVE="ONDR18" 42 | 43 | # Function to check whether MAU 3.18 or later command-line updates are available 44 | function CheckMAUInstall() { 45 | if [ ! -e "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" ]; then 46 | echo "ERROR: MAU 3.18 or later is required!" 47 | exit 1 48 | fi 49 | } 50 | 51 | # Function to check whether we are allowed to send Apple Events to MAU 52 | function CheckAppleEvents() { 53 | MAURESULT=$(${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --config | /usr/bin/grep 'No result returned from Update Assistant') 54 | if [[ "$MAURESULT" = *"No result returned from Update Assistant"* ]]; then 55 | echo "ERROR: Cannot send Apple Events to MAU. Check privacy settings" 56 | exit 1 57 | fi 58 | } 59 | 60 | # Function to check whether MAU is up-to-date 61 | function CheckMAUUpdate() { 62 | MAUUPDATE=$(${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --list | /usr/bin/grep 'MSau04') 63 | if [[ "$MAUUPDATE" = *"MSau04"* ]]; then 64 | echo "Updating MAU to latest version... $MAUUPDATE" 65 | echo "$(/bin/date)" 66 | RESULT=$(${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --install --apps MSau04) 67 | sleep 120 68 | fi 69 | } 70 | 71 | # Function to check whether its safe to close Excel because it has no open unsaved documents 72 | function OppCloseExcel() { 73 | APPSTATE=$(${CMD_PREFIX}/usr/bin/pgrep "Microsoft Excel") 74 | if [ ! "$APPSTATE" == "" ]; then 75 | DIRTYDOCS=$(${CMD_PREFIX}/usr/bin/defaults read com.microsoft.Excel NumTotalBookDirty) 76 | if [ "$DIRTYDOCS" == "0" ]; then 77 | echo "$(/bin/date)" 78 | echo "Closing Excel as no unsaved documents are open" 79 | $(${CMD_PREFIX}/usr/bin/pkill -HUP "Microsoft Excel") 80 | fi 81 | fi 82 | } 83 | 84 | # Function to determine the logged-in state of the Mac 85 | function DetermineLoginState() { 86 | # The following line is is taken from: https://erikberglund.github.io/2018/Get-the-currently-logged-in-user,-in-Bash/ 87 | CONSOLE="$(/usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | /usr/bin/awk '/Name :/ && ! /loginwindow/ { print $3 }')" 88 | if [ "$CONSOLE" == "" ]; then 89 | echo "No user currently logged in to console - using fall-back account" 90 | CONSOLE=$(/usr/bin/last -1 -t ttys000 | /usr/bin/awk '{print $1}') 91 | echo "Using account $CONSOLE for update" 92 | userID=$(/usr/bin/id -u "$CONSOLE") 93 | CMD_PREFIX="/bin/launchctl asuser $userID " 94 | else 95 | echo "User $CONSOLE is logged in" 96 | userID=$(/usr/bin/id -u "$CONSOLE") 97 | CMD_PREFIX="/bin/launchctl asuser $userID " 98 | fi 99 | } 100 | 101 | # Function to register an application with MAU 102 | function RegisterApp() { 103 | $(${CMD_PREFIX}/usr/bin/defaults write com.microsoft.autoupdate2 Applications -dict-add "$1" "{ 'Application ID' = '$2'; LCID = 1033 ; }") 104 | } 105 | 106 | # Function to flush any existing MAU sessions 107 | function FlushDaemon() { 108 | $(${CMD_PREFIX}/usr/bin/defaults write com.microsoft.autoupdate.fba ForceDisableMerp -bool TRUE) 109 | $(${CMD_PREFIX}/usr/bin/pkill -HUP "Microsoft Update Assistant") 110 | } 111 | 112 | # Function to call 'msupdate' and update the target applications 113 | function PerformUpdate() { 114 | echo "$(/bin/date)" 115 | ${CMD_PREFIX}/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --install --apps $1 --wait 600 2>/dev/null 116 | } 117 | 118 | ## MAIN 119 | echo "Started - $(/bin/date)" 120 | DetermineLoginState 121 | CheckMAUInstall 122 | FlushDaemon 123 | CheckAppleEvents 124 | CheckMAUUpdate 125 | FlushDaemon 126 | RegisterApp "$PATH_WORD" "$APPID_WORD" 127 | RegisterApp "$PATH_EXCEL" "$APPID_EXCEL" 128 | RegisterApp "$PATH_POWERPOINT" "$APPID_POWERPOINT" 129 | RegisterApp "$PATH_OUTLOOK" "$APPID_OUTLOOK" 130 | RegisterApp "$PATH_ONENOTE" "$APPID_ONENOTE" 131 | RegisterApp "$PATH_SKYPEBUSINESS" "$APPID_SKYPEBUSINESS" 132 | RegisterApp "$PATH_REMOTEDESKTOP" "$APPID_REMOTEDESKTOP" 133 | RegisterApp "$PATH_COMPANYPORTAL" "$APPID_COMPANYPORTAL" 134 | RegisterApp "$PATH_DEFENDER" "$APPID_DEFENDER" 135 | RegisterApp "$PATH_EDGE $APPID_EDGE" 136 | RegisterApp "$PATH_TEAMS $APPID_TEAMS" 137 | RegisterApp "$PATH_ONEDRIVE $APPID_ONEDRIVE" 138 | OppCloseExcel 139 | 140 | PerformUpdate "$APPID_WORD $APPID_EXCEL $APPID_POWERPOINT $APPID_OUTLOOK $APPID_ONENOTE $APPID_SKYPEBUSINESS $APPID_REMOTEDESKTOP $APPID_COMPANYPORTAL $APPID_DEFENDER $APPID_EDGE $APPID_TEAMS $APPID_ONEDRIVE" 141 | 142 | echo "Finished - $(/bin/date)" 143 | 144 | exit 0 145 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # msupdatehelper 2 | 3 | NOTE: The helper scripts are now deprecated. Use the new deffered and version pinning capability in Microsoft AutoUpdate for scenarios where you need more control over the timing of updates. See https://www.kevinmcox.com/2021/10/microsoft-now-provides-curated-deferral-channels-for-autoupdate/ for more details. 4 | 5 | --------------------------------------------------------------------------------