One of the advantages provided by Jamf Pro’s Self Service is that you can use it to provide easy access to tools for your users or helpdesk folks. One such tool could be a script which helps folks boot to their Macs to one of the following Apple support services:
- Diagnostics / Apple Hardware Test: https://support.apple.com/HT202731
- macOS Recovery: https://support.apple.com/HT201314
For more details, please see below the jump.
This script sets one of four boot arguments and passes it to NVRAM:
- RecoveryModeDisk – Boots to the Recovery volume on your local boot drive
- RecoveryModeNetwork – Boots to Internet Recovery
- DiagsModeDisk – Boots to the Diagnostics or Apple Hardware Test volume on your local boot drive.
- DiagsModeNetwork – Boots to Internet Diagnostics or Apple Hardware Test
Note: If booting to macOS Recovery, this script will set the logged-in account to have admin privileges. This is because, on Macs equipped with T2 security chips, an admin account is needed to be able to access the macOS Utilities tools in the Recovery environment.
To set it up for use with Jamf Pro, do the following:
1. Add the script to Jamf Pro.
2. Create a new Self Service policy.
3. Select the script as part of the policy.
4. Set the policy’s Execution Frequency to Ongoing.
5. Set target scope as desired.
Note: While this script was written with Jamf Pro’s Self Service in mind, it should be adaptable with either no alteration or minor edits to other Self Service tools which can run scripts.
Once the policy is set up in Jamf Pro, it should look like this when run.
When the Mac restarts, it should boot to Diagnostics or macOS Recovery (depending on your choices.)
The script is available below. It is also available from the following location on GitHub: