使用 Jamf Pro 自动注册 macOS 设备
本文介绍如何在 macOS 设备上使用 Jamf Pro 配置和部署 HP Insights macOS 代理。
先决条件
- 从 Workforce Experience Platform 获取公司范围的 PIN。
- 在平台的左侧菜单中,单击“ 设置 ”> “首选项” 选项卡> “公司 Pin”。
- 从 https://workforceexperience.hp.com/software 下载最新的 HP Insights macOS 应用程序。
- 下载并安装 Jamf Pro Installer.pkg
- 根据以下选项复制并保存必要的脚本,以在 Jamf Pro 控制台中配置应用程序:
- 如果设备不需要隐藏菜单栏的选项,请复制下面的 Enrollment.sh脚本文本。
- 如果设备需要隐藏菜单栏的选项,请复制下面的 Enrollment_Tray.sh 脚本文本。
- 如果设备已注册 HP Insights macOS 代理或自动升级到 macOS 版本 2.23.6,并且希望隐藏菜单栏图标,请复制下面的 ShowTray.sh 并 HideTray.sh 脚本文本。
如果设备已注册,请参阅下面的“已注册设备”安装部分。
在 Jamf Pro 控制台中配置应用程序的脚本
- Enrollment.sh
- 此脚本将通过静默注册设备,无需用户交互。
- 需要在脚本中更新 CPIN。
- Enrollment_Tray.sh (适用于 macOS 应用程序版本 2.23.6)
- 此脚本将通过静默注册设备,无需用户交互。
- 这将隐藏托盘(菜单栏)。
- 需要在脚本中更新 CPIN。
- ShowTray.sh (适用于 macOS 应用程序版本 2.23.6)
- 此脚本将显示托盘(菜单栏)图标。
- 对于已注册 HP Insights 代理的设备,需要此脚本。
- HideTray.sh (适用于 macOS 应用程序版本 2.23.6)
- 此脚本将隐藏托盘(菜单栏)图标。
- 对于已注册 HP Insights 代理的设备,需要此脚本。
Enrollment.sh 脚本
在下面的脚本中,将“PIN”替换为实际的公司 PIN。
#!/bin/bash
APPLICATION_SUPPORT_DIRECTORY=/etc/APMAgent
PIN=#########
if [ -d $APPLICATION_SUPPORT_DIRECTORY ]
then
echo "Directory Exists"
else
echo "Directory Does not exist, creating directory"
mkdir "$APPLICATION_SUPPORT_DIRECTORY"
fi
echo "{\"PIN\":\"$PIN\"}" > "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
if [ "$APPLICATION_SUPPORT_DIRECTORY\enrollment.json" ]
then
echo "Successfully stored Data at
$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
cat "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
exit 0
else
echo "Unable to store Data"
exit 1
fi
exit 1
Enrollment_Tray.sh脚本
在下面的脚本中,将“PIN”替换为实际的公司 PIN。
#!/bin/bash
APPLICATION_SUPPORT_DIRECTORY=/etc/APMAgent
PIN=#########
if [ -d $APPLICATION_SUPPORT_DIRECTORY ]
then
echo "Directory Exists"
else
echo "Directory Does not exist, creating directory"
mkdir "$APPLICATION_SUPPORT_DIRECTORY"
fi
echo "{\"PIN\":\"$PIN\",\"HideTray\":\"true\"}" > "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
if [ "$APPLICATION_SUPPORT_DIRECTORY\enrollment.json" ]
then
echo "Successfully stored Data at
$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
cat "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
exit 0
else
echo "Unable to store Data"
exit 1
fi
exit 1
ShowTray.sh 脚本
#!/bin/bash
APPLICATION_SUPPORT_DIRECTORY=/etc/APMAgent
if [ -d $APPLICATION_SUPPORT_DIRECTORY ]
then
echo "Directory Exists"
else
echo "Directory Does not exist, creating directory"
mkdir "$APPLICATION_SUPPORT_DIRECTORY"
fi
echo "{\"HideTray\":\"false\"}" > "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
if [ "$APPLICATION_SUPPORT_DIRECTORY\enrollment.json" ]
then
echo "Successfully create enrolment json at
$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
cat "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
exit 0
else
echo "Unable to store PIN"
exit 1
fi
exit 1
HideTray.sh 脚本
#!/bin/bash
APPLICATION_SUPPORT_DIRECTORY=/etc/APMAgent
if [ -d $APPLICATION_SUPPORT_DIRECTORY ]
then
echo "Directory Exists"
else
echo "Directory Does not exist, creating directory"
mkdir "$APPLICATION_SUPPORT_DIRECTORY"
fi
echo "{\"HideTray\":\"true\"}" > "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
if [ "$APPLICATION_SUPPORT_DIRECTORY\enrollment.json" ]
then
echo "Successfully create enrolment json at
$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
cat "$APPLICATION_SUPPORT_DIRECTORY/enrollment.json"
exit 0
else
echo "Unable to store PIN"
exit 1
fi
exit 1
在 Jamf Pro 控制台中上传和配置应用程序
配置 HP Insights 代理会有所不同,具体取决于设备是在 HP Insights 代理中注册还是取消注册。可以在下面找到这两个迭代的说明:
未注册的设备
- 在 Jamf Pro 控制台中,单击> 计算机 > 管理设置。
- 在 “计算机管理”下,选择 “包”。
- 在 “包” 窗口中,单击 “新建” 以添加之前下载的 HP Insights macOS 应用程序包。
- 显示名称:输入包的名称
- 类别: 选择应用
- 文件名:上传 HP Insights macOS 应用程序包文件
- 点击 保存。
- 在 “计算机管理” 部分中,选择 “脚本”。
- 在 “脚本” 窗口中,单击 “新建” 以添加 HP Insights 安装脚本。
- 显示名称:输入脚本名称
- 类别: 脚本
- 点击 保存。
- 单击 “脚本” 选项卡并复制上面选择的脚本。确保
脚本中的 替换为实际的公司 PIN。 - 单击 “选项” 选项卡。
- 在优先级中,选择 之后
- 点击 保存。
- 转到 “计算机” 选项卡,然后单击 “策略”。
- 单击 新建。
- 在 “常规 ”部分中:
- 显示名称:输入策略的名称
- 选中 已启用
- 类别: 选择 应用
- 触发器: 检查注册完成和定期签入
- 在 “包 ”部分中,单击 “配置”。
- 选择之前创建的包。
- 分发点:选择每台计算机的默认分发点
- 作:选择 安装
- 在 脚本 部分中,单击 配置。
- 选择之前创建的脚本。
- 优先级:选择 之后
- 在 “范围” 选项卡中,根据需要定位设备。
- 在“自助服务”选项卡中,选中“在自助服务中使策略可用”
- 自助服务显示名称:输入包的名称和描述
- 按钮名称:您还可以添加图标
- 在 “常规 ”部分中:
- 点击 保存。
已注册的设备
如果设备已经安装了 HP Insights macOs 代理,并且用户想要切换隐藏菜单栏应用程序,则用户可以通过在控制台中运行 或 ShowTray.sh HideTray.sh 脚本来继续。该过程将与上面列出的“尚未注册的设备”相同;但是,在输入脚本时,输入 sudo bash ./ShowTray.sh 或 sudo bash ./HideTray.sh 分别。
使用 ShowTray.sh 或 HideTray.sh 时,无需提供 PIN。
联系我们
如需任何帮助, 请创建支持案例 或电子邮件 support@wxp.hp.com。