--- title: "MacOS:使用公司PIN手动注册设备" slug: "manually-enroll-macos-device-using-company-pin" description: "Enroll and deploy the HP Insights Agent on macOS with a company-wide PIN. Follow our guide for seamless configuration and management of devices." updated: 2026-08-20T03:46:25Z published: 2026-08-20T03:46:25Z canonical: "learn.workforceexperience.hp.com/manually-enroll-macos-device-using-company-pin" --- > ## Documentation Index > Fetch the complete documentation index at: https://learn.workforceexperience.hp.com/llms.txt > Use this file to discover all available pages before exploring further. # MacOS:使用公司PIN手动注册设备 ## 介绍 本文提供了使用公司PIN为Mac OS设备注册和部署 [WXP](https://workforceexperience.hp.com/) Insights代理(Workforce Experience Platform (WXP) 的核心组件)的指导: 1. 从 [Download WXP Insights Software](https://workforceexperience.hp.com/software/) 页面下载适用于macOS的最新WXP Insights代理。 2. 选择根据首选项配置Mac Script Editor应用程序的脚本。 3. 从WXP获取公司PIN: a. 从WXP的左侧菜单中,单击**设置 > 首选项**。将显示**首选项**选项卡。 b. 在**首选项**选项卡中,向下滚动到**公司PIN**部分并复制该PIN。 4. 为macOS配置代理。 > **注意**:macOS设备不支持在HP Workforce Experience Platform中注册的代理配置。 ## 选择一个脚本以配置 Mac 脚本编辑器应用程序 下载最新的 WXP Insights macOS 应用程序后,复制并保存必要的脚本,以根据首选项配置脚本编辑器应用程序。编辑脚本时,请确保将“PIN=”更改为公司 PIN。 1. **Enrollment.sh**:显示菜单栏并注册设备,无需用户交互(在脚本中更新 CPIN) 2. **Enrollment_Tray.sh**:隐藏菜单栏并在没有用户交互的情况下注册设备(在脚本中更新 CPIN) 3. **ShowTray.sh**:显示菜单栏;适用于已注册 WXP Insights Agent 并自动升级到 macOS 版本 2.23.6(及更高版本)的设备 4. **HideTray.sh**:隐藏菜单栏;适用于已注册 WXP Insights Agent 并自动升级到 macOS 版本 2.23.6(及更高版本)的设备 如果设备已注册,请参阅下面的“已注册设备”部分。 ### Enrollment.sh 脚本 ```plaintext #!/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脚本 ```plaintext #!/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 脚本 ```plaintext #!/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 脚本 ```plaintext #!/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 ``` ### 获取公司PIN 要获取公司PIN: 1. 登录**WXP**。将显示**主页**。 2. 从WXP的左侧菜单中,选择**设置 > 首选项**。将显示**首选项**选项卡。 3. 在**首选项**选项卡中,向下滚动到公司PIN部分并复制该PIN。 对于HP合作伙伴:接受合作伙伴邀请后,登录WXP。选择**客户 > 公司 > 公司详细信息 > 首选项**。 ## 配置 macOS 应用程序 配置 WXP Insights macOS 代理取决于设备是否已注册。两者的说明如下: ### 已取消注册的设备 1. 下载 WXP Insights macOS 应用程序后,打开脚本编辑器应用程序并复制上述脚本之一。确保将“PIN”替换为实际的公司 PIN 并运行所选脚本。 - 必须在安装 macOS 应用程序之前执行所选脚本 2. 执行所选脚本后,打开 [HPInsightsInstaller.pkg](https://workforceexperience.hp.com/software) 以安装 WXP Insights macOS 代理。安装后,注册会自动开始 3. 在状态栏上,单击 HP 图标,然后选择**注册此设备。** 4. 在平台窗口中,单击 **注册** 以继续。 5. 如果设备归公司所有,请选择 **“公司** ”,如果设备归个人所有,请选择 **“个人** ”,然后单击 **“下一步**”。 - 如果选择 **个人** ,则某些功能可能会被禁用。 6. 输入公司 PIN,然后单击 **下一步**。 7. 当注册确认窗口出现时,单击 **“是** ”以授权公司拥有的计算机。对于个人拥有的计算机,请根据公司策略单击“是”或“否” - 将出现一个确认窗口,如果计算机已成功注册,则显示设备已注册。请记住,计算机在注册期间必须连接到 Internet - 单击详细信息以获取有关注册的详细信息。 ### 已注册的设备 如果用户已经安装了 WXP Insights macOS 代理并希望切换隐藏菜单栏应用程序,则用户可以通过在控制台中运行 `ShowTray.sh` 或 `HideTray.sh` 脚本来继续。 1. 在脚本编辑器应用程序中,输入 `sudo bash ./ShowTray.sh` 或 `sudo bash ./HideTray.sh`。 2. 输入所需脚本后,系统将提示用户输入 PIV 身份验证的 PIN。 输入 PIN 后,设备将成功运行脚本以显示或隐藏菜单栏。 ## **联系我们** 如需帮助,请创建[**支持案例**](/wxp/docs/zh-cn/creating-a-support-case)或发送电子邮件至 [**support@wxp.hp.com**](mailto:support@wxp.hp.com)。 ## Related - [Workforce Experience Platform 概述](/overview-of-workforce-experience-platform.md) - [透過 Intune 部署 macOS Agent](/deploy-via-jamf-pro.md)