You can enter the management ID of the target computer into a command to set the Recovery Lock on the computer via MDM.
Important:
For security reasons, Jamf does not recommend running scripts that contain user or API credentials from managed computers.
Requirements
A management ID for target computers
The Send Set Recovery Lock Command privilege in Jamf Pro
The following code sample demonstrates how to set Recovery Lock with a password:
curl
--location
--request POST 'https://JAMF_PRO_URL/api/v2/mdm/commands' \
--header 'Authorization: Bearer JAMF_PRO_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"clientData": [
{
"managementId": "A9C3D1F0-DCB2-4D52-84C6-D5AD60140B04",
"clientType": "COMPUTER"
}
],
"commandData": {
"commandType": "SET_RECOVERY_LOCK",
"newPassword": "password"
}
}'Note:
To clear the password instead of set the password, set the newPassword key to an empty string.
The Recovery Lock is immediately set on target computers and the password is stored in Jamf Pro.