使用 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

注意

只有以下应用程序更新支持该--version选项:Word、Excel、PowerPoint、Outlook、OneNote

如何使用 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 的最新可用更新,等待 180 秒 (3 分钟) 再关闭 Excel,并在 macOS 上显示“Excel 将在 3 分钟后关闭以安装更新。”横幅通知以通知用户: ./msupdate --install --apps XCEL2019 -t 180 -m "Excel will close in 3 minutes to install updates."

注意

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

应用程序标识符

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

应用程序 标示符
Excel XCEL2019
Intune 公司门户 IMCP01
许可帮助程序工具 OLIC02
MAU MSau04
Microsoft Copilot MSCP10
适用于消费者的 Microsoft Defender WDAVCONSUMER
Microsoft Defender for Endpoint WDAV00
Microsoft Defender 填充码 WDAVSHIM
OneDrive ONDR18
OneNote ONMC2019
Outlook OPIM2019
PowerPoint PPT32019
快速助手 MSQA01
远程帮助 MSRH01
Skype for Business MSFB16
Teams 1.0(经典) TEAMS10
Teams 2.1 TEAMS21
Windows 应用 MSRD10
Word MSWD2019

注意

  • 远程桌面现在更名为 Windows 应用。 使用新名称更新配置以继续接收更新。
  • Office 应用(如 Word 和 Outlook)的标识符可用于以下版本:
    • Microsoft 365 Mac 版
    • Office LTSC for Mac 2024 (批量许可证)
    • Office LTSC for Mac 2021 (批量许可证)
  • 如果 MAU 本身有挂起的更新,则必须先应用该更新,然后才能更新任何应用程序。
  • 从命令行以交互方式运行时,标识符不区分大小写,但在从 Jamf Pro 等管理工具运行时使用表中的字符大小写。
  • 在某些情况下,Microsoft Teams 可能会使用 MAU 提供更新,例如,如果 Teams 更新程序失败。 但是,你不能使用 msupdate 让 MAU 管理 Teams 的更新,因为 Teams 不为管理员提供部署和管理更新的功能。 相反,Teams 大约每隔两周自动更新一次新功能和质量更新。 有关详细信息,请参阅 Teams 更新过程。
  • 自 2025 年 7 月 1 日起,经典 Teams 不再可用。