欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

https://developer.jamf.com/jamf-pro/v11.0.0/reference/createcomputercommandbycommandandid ScheduleOSUpdate 什么意思 AG chatgpt 有大用 有大大用

ScheduleOSUpdate 在 Jamf Pro API 中的含义

在 Jamf Pro API 中,ScheduleOSUpdate 是一个 计算机命令(Computer Command),用于向 macOS 设备 发送系统更新(macOS 升级或补丁)的安装计划。


🔹 功能说明

1. 作用

  • 让 Jamf Pro 远程安排 macOS 设备安装系统更新(如 macOS 小版本更新、完整大版本升级)。

  • 适用于:

    • 企业 IT 管理的 Mac 设备。

    • 需要通过 Jamf Pro 批量推送 macOS 更新 的场景。

2. 支持的更新类型

  • macOS 大版本升级(如 macOS Ventura → macOS Sonoma)。

  • 小版本更新(如 macOS 14.4 → macOS 14.5)。

  • 安全补丁(如 2024-001 Security Update)。


🔹 API 调用方式

1. 基本 XML 请求示例

xml
<computer_command>    <general>        <command>ScheduleOSUpdate</command>        <os_update>            <action>download</action>  <!-- 或 "install" -->            <product_key>macOS Sonoma</product_key>  <!-- 更新的具体版本 -->        </os_update>    </general>    <computers>        <computer>            <id>123</id>  <!-- 目标设备的 Jamf ID -->        </computer>    </computers> </computer_command>

2. 主要参数说明

参数可选值说明
<action>downloadinstalldownload(仅下载但不安装)、install(下载 + 安装)
<product_key>如 macOS SonomaMSU_Update_2024-001指定具体的更新包(可查 Jamf Pro 可用的更新列表)
<computer_id>Jamf Pro 设备 ID目标设备(可多个)

3. curl 调用示例

bash
curl -X POST \  -H "Authorization: Bearer YOUR_API_TOKEN" \  -H "Content-Type: application/xml" \  -d ' <computer_command>    <general>        <command>ScheduleOSUpdate</command>        <os_update>            <action>install</action>            <product_key>macOS Sonoma</product_key>        </os_update>    </general>    <computers>        <computer>            <id>123</id>        </computer>    </computers> </computer_command>' \  "https://your-jamf-server.com/JSSResource/computercommands/command/ScheduleOSUpdate/id/123"

🔹 更新何时生效?

取决于 <action> 和 设备策略

<action>触发方式用户是否可干预?
download仅下载更新(不安装)用户需手动安装
install下载 + 安装默认 后台静默安装(可配置是否弹窗提示)

更新执行时间

  • 设备在线:Jamf Pro 会立即推送命令(通常在几分钟内生效)。

  • 设备离线:下次 Check-In(通常 15 分钟 ~ 1 小时)时执行。

  • 安装时间

    • 小更新(如安全补丁)可能 不需要重启

    • 大版本升级(如 Sonoma → 新版本)会 强制重启设备(建议安排在非工作时间)。


🔹 注意事项

1. 设备要求

  • macOS 10.13+(旧版本可能不支持)。

  • 设备需管理(Jamf Agent 正常运行)

  • 用户权限

    • 普通用户可能无法安装大版本更新(需管理员权限)。

    • 企业可配置 无人值守安装(不弹窗)。

2. 与其他 Jamf 策略的配合

  • 延迟安装:可通过 Deferral 策略让用户选择稍后安装。

  • 强制更新:结合 Enforce 策略,设置截止时间(逾期强制安装)。


🔹 最佳实践

  1. 先测试再批量部署(避免大规模设备意外升级)。

  2. 使用 download 模式提前缓存更新(减少占用带宽)。

  3. 结合维护窗口(避免影响工作时间)。

  4. 监控更新状态(通过 Jamf Pro 报告或 sudo softwareupdate --list)。


总结

ScheduleOSUpdate 是 Jamf Pro 提供的 macOS 远程更新管理功能,适用于企业 IT 批量控制设备升级。通过 API 调用可灵活控制 下载、安装、更新版本、目标设备,适合自动化运维。
⚠️ 注意:大版本升级可能重启设备,务必提前通知用户!


普通分类: