使用 msupdate 更新适用于 Mac 的 Microsoft 应用程序

Microsoft AutoUpdate (MAU) 3.18 及更高版本包括 msupdate 命令行工具。 msupdate 工具可用于启动为 Mac 生成的 Microsoft 应用程序(如 Office)的更新过程。 该工具主要用于让 IT 管理员更精确地控制何时应用更新。 可以从 此链接下载最新版本的 MAU。

msupdate 的工作原理是使用本机 XPC 与 MAU 守护程序通信。 在 macOS 10.14 Mojave 及更高版本上,首次运行 msupdate 时,可能会看到隐私提示。 如果使用企业管理工具(如 Jamf Pro),则应部署隐私首选项策略控制 (PPPC) 有效负载来预先批准访问权限。 可以从 GitHub 下载此类有效负载的示例。

使用以下步骤开始使用该工具:

  1. 打开终端应用程序
  2. 输入 cd /Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS
  3. 运行 ./msupdate --help

页面上会显示下列选项:

 usage: msupdate <command> [<args> ...] <modifier> 

 Commands: 
    -h | --help           Show usage information 
    -c | --config         Display current AutoUpdate configuration 
    -l | --list           List available updates for installed Microsoft applications 
    -i | --install        Download and install available updates 

 Modifiers: 
    -a | --apps <app>     Install specific application updates 
    -v | --version <app>  Only update to a specific version 
    -w | --wait <secs>    Number of seconds to wait for action to complete before returning the current state of the install command 
    -f | --format         Format output results in the specified format 
        p | plist         Property list format
    -t | --terminate <secs>  Number of seconds to wait before closing opened applications in order for updates to complete
       -m | --message <msg>  Optional message to display on macOS banner notification to notify user

如何使用 msupdate 的示例

  • 显示 MAU 的当前配置参数: ./msupdate --config
  • 以计算机可读格式显示当前配置参数: ./msupdate --config --format plist
  • 列出所有可用更新: ./msupdate --list
  • 下载并安装所有可用更新: ./msupdate --install
  • 下载并安装 Word、Excel 和 PowerPoint 的最新更新:./msupdate --install --apps MSWD2019 XCEL2019 PPT32019
  • 下载并安装特定于版本的 Outlook 更新: ./msupdate --install --apps OPIM2019 --version 16.17.180090901
  • 下载并安装 Excel 的最新可用更新,在关闭 Excel 之前等待 180 秒 (3 分钟) ,并在 macOS 横幅通知上显示“Excel 将在 3 分钟内关闭以安装更新”。以通知用户: ./msupdate --install --apps XCEL2019 -t 180 -m "Excel will close in 3 minutes to install updates."

注意

若要使用 -t 和 -m 修饰符,必须使用 Microsoft AutoUpdate 4.24 或更高版本。

应用程序标识符

下表列出了 MAU 支持的适用于 Mac 的 Microsoft 应用程序。 指定 --apps 参数时使用标识符。 在命令行上指定多个应用程序时,请用空格分隔标识符。

应用程序 标示符
Word MSWD2019
Excel XCEL2019
PowerPoint PPT32019
Outlook OPIM2019
OneNote ONMC2019
MSau04
OneDrive ONDR18
Teams 1.0 经典版 TEAMS10
Teams 2.1 TEAMS21
Skype for Business MSFB16
远程桌面 MSRD10
Intune 公司门户 IMCP01
Microsoft Defender for Endpoint WDAV00
面向使用者的Microsoft Defender WDAVCONSUMER
Microsoft Defender填充码 WDAVSHIM
许可帮助程序工具 OLIC02

注意

  • Office 应用的标识符(如 Word 和 Outlook)可用于以下版本:
    • Office for Mac (Microsoft 365 或 Office 365 订阅计划)
    • Office LTSC for Mac 2021 (批量许可证)
    • Office 2019 for Mac (零售或批量许可证)
  • 如果 MAU 本身的更新处于挂起状态,则必须在更新任何应用程序之前应用该更新。
  • 从命令行以交互方式运行时,标识符不区分大小写,但在从 Jamf Pro 等管理工具运行时,使用表中的字符大小写。
  • 在某些情况下,Microsoft Teams 可能会使用 MAU 提供更新,例如 Teams 更新程序失败。 但是,不能使用 msupdate 让 MAU 管理 Teams 的更新,因为 Teams 没有为管理员提供部署和管理更新的功能。 相反,Teams 大约每两周自动更新一次,其中包含新功能和质量更新。 有关详细信息,请参阅 Teams 更新过程