Using the Jamf Pro API to retrieve Recovery Lock passwords

A while back, I wrote a script which uses Jamf Pro’s Classic and Jamf Pro API to retrieve FileVault recovery keys. As part of assisting with a recent issue, I decided to develop a similar one for retrieving Recovery Lock passwords (these are alternatively referred to in Apple’s documentation as recoveryOS passwords.) The resulting script uses the Jamf Pro API to take a list of Jamf Pro computer IDs from a plaintext file, retrieve the associated Macs’ Recovery Lock passwords (if one is set) and generate a report in TSV format.

For more details, please see below the jump.

Pre-requisites:

If setting up an API client for this purpose with limited rights, here are the required API Role privileges for the API client on the Jamf Pro server:

  • Read Computers
  • View Recovery Lock

For authentication, the script can accept manual input or values stored in a ~/Library/Preferences/com.github.jamfpro-info.plist file.

The plist file can be created by running the following commands and substituting your own values where appropriate:

To store the Jamf Pro URL in the plist file:



This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


defaults write com.github.jamfpro-info jamfpro_url https://jamf.pro.server.goes.here:port_number_goes_here
view raw

gistfile1.txt

hosted with ❤ by GitHub

To store the API Client ID in the plist file:



This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


defaults write com.github.jamfpro-info jamfpro_api_client_id api_client_id_information_goes_here
view raw

gistfile1.txt

hosted with ❤ by GitHub

To store the API Client Secret in the plist file:



This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


defaults write com.github.jamfpro-info jamfpro_api_client_secret api_client_secret_information_goes_here
view raw

gistfile1.txt

hosted with ❤ by GitHub

This script imports a list of Jamf Pro computer ID numbers from a plaintext file and uses that information to generate a report about the Recovery Lock passwords associated with those computers. The plaintext file format should look like this:



This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


19
55
72
93

Usage:

/path/to/generate_filevault_recovery_key_report_from_jamf_pro_id_numbers /path/to/jamf_pro_id_numbers.txt

Once the Jamf Pro computer ID numbers are read from in from the plaintext file, the script takes the following actions:

1. Uses the Jamf Pro API to download all information about the matching computer inventory record.
2. Pulls the following information out of the inventory entry:

  • Jamf Pro ID
  • Manufacturer
  • Model
  • Serial Number
  • Hardware UDID

3. Runs a separate API call to retrieve the following:

  • Recovery Lock Password

4. Create a report in tab-separated value (.tsv) format which contains the following information about the deleted Macs

  • Jamf Pro ID
  • Manufacturer
  • Model
  • Serial Number
  • Hardware UDID
  • Recovery Lock Password Available
  • Recovery Lock Password (if no password is set, NA is reported for the Recovery Lock Password column.)
  • Jamf Pro URL for the computer inventory record

The script should display output similar to this:



This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


username@computername ~ % /Users/Shared/Generate_Recovery_Lock_Password_Report_From_Jamf_Pro_ID_Numbers.sh jamf_pro_id_numbers.txt
Please enter your Jamf Pro server URL : https://jamf.pro.server.here
Please enter your Jamf Pro API client ID : 52d62208-4eb8-45f9-af54-5aa2e4273029
Please enter the API client secret for the 52d62208-4eb8-45f9-af54-5aa2e4273029 API ID client:
Report being generated. File location will appear below once ready.
Report on Recovery Lock passwords available here: /var/folders/ps/2_yw29gj711c9d7c5w5jhyv80000gp/T/tmp.6YgzNdcgqV.tsv
username@computername ~ %
view raw

gistfile1.txt

hosted with ❤ by GitHub

The resulting report in TSV format will contain information similar to what’s shown below:



Jamf Pro ID Number Manufacturer Model Serial Number UDID Recovery Lock Password Available Recovery Lock Password Jamf Pro URL
19 Apple MacBook Pro (13-inch, M1, 2020) C02X25CTPSYN 1B71C903-3BD7-441F-B063-4B49F232123A No NA https://jamf.pro.server.here/computers.html?id=19
55 Apple MacBook Pro (14-inch, 2021) INU1GX7R3Y F5F3E415-7A82-4A10-BF78-EAB6561670DA No NA https://jamf.pro.server.here/computers.html?id=55
72 Apple Mac mini (2024) S8M1HLP3VW 7D262319-3403-425E-AAF7-A5D6B62C31E0 Yes u+K0nrZVOvknZszakL9Rzg== https://jamf.pro.server.here/computers.html?id=72
93 Apple MacBook Pro (14-inch, Nov 2023) WZ3B1JOPTT FC3F10BA-ED5E-4F50-AD34-B70D04276984 Yes Qf7b5gXDBDjwyn0QLRQymA== https://jamf.pro.server.here/computers.html?id=93

This script is available from GitHub at the following location:

https://github.com/rtrouton/rtrouton_scripts/tree/main/rtrouton_scripts/Casper_Scripts/Generate_Recovery_Lock_Password_Report_From_Jamf_Pro_ID_Numbers

In addition to the script described above which use API client authentication, there is also a matching script which uses user accounts for authentication available on GitHub via the link above. If setting up a user account with limited rights, here are the required API privileges for the user account on the Jamf Pro server:

Jamf Pro Server Objects:

  • Computers: Read

Jamf Pro Server Actions:

  • View Recovery Lock

Citrix NetScaler (CVE-2026-19490) : cette faille critique permet de contourner l’authentification

Citrix a corrigé deux vulnérabilités dans NetScaler ADC et Gateway. La CVE-2026-19490 ouvre la porte à un contournement de l'authentification à distance.

Le post Citrix NetScaler (CVE-2026-19490) : cette faille critique permet de contourner l’authentification a été publié sur IT-Connect.

Keycloak : cette faille critique permet de pirater un compte via la fonction de mot de passe oublié

La faille CVE-2026-18963 permet de réinitialiser le mot de passe de n'importe quel compte Keycloak sans authentification. Un patch est disponible.

Le post Keycloak : cette faille critique permet de pirater un compte via la fonction de mot de passe oublié a été publié sur IT-Connect.

Endstate : sauvegarder et restaurer ses applications Windows (et leurs configs) sur un nouveau PC

Découvrez Endstate, un outil open source qui sauvegarde les applications et les réglages d'un PC Windows dans un fichier, puis les restaure sur un nouveau PC.

Le post Endstate : sauvegarder et restaurer ses applications Windows (et leurs configs) sur un nouveau PC a été publié sur IT-Connect.

Entra ID : une faille critique a été patchée, mais vous n’avez rien à faire

Microsoft a corrigé la CVE-2026-69836, une faille critique dans Entra ID déjà exploitée dans la nature. La bonne nouvelle : vous n'avez rien à faire.

Le post Entra ID : une faille critique a été patchée, mais vous n’avez rien à faire a été publié sur IT-Connect.

Graft, l’outil open source qui cartographie votre code pour les agents IA

Graft, outil open source signé Nanonets, transforme votre dépôt en graphe Markdown lisible par Claude Code, Cursor ou Codex. De quoi brûler moins de tokens.

Le post Graft, l’outil open source qui cartographie votre code pour les agents IA a été publié sur IT-Connect.

GitLab : la faille critique CVE-2026-19478 est déjà exploitée, deux jours après le correctif

Deux jours après le correctif publié par GitLab, la faille critique CVE-2026-19478 fait l'objet de tentatives d'exploitation par les pirates.

Le post GitLab : la faille critique CVE-2026-19478 est déjà exploitée, deux jours après le correctif a été publié sur IT-Connect.

Windows 11 : la mise à jour KB5121003 fait planter des jeux, Microsoft cherche une solution

Microsoft enquête sur les plantages de jeux provoqués par la mise à jour KB5121003 de Windows 11. Le studio Embark pointe le pilote tiers inpoutx64.sys.

Le post Windows 11 : la mise à jour KB5121003 fait planter des jeux, Microsoft cherche une solution a été publié sur IT-Connect.

Proton Mail trie enfin vos e-mails automatiquement, et sans lire leur contenu

Proton déploie les catégories dans Proton Mail : six onglets pour trier vos e-mails entrants, avec un classement basé sur les métadonnées et non sur le contenu.

Le post Proton Mail trie enfin vos e-mails automatiquement, et sans lire leur contenu a été publié sur IT-Connect.

Elementor Pro : une faille critique permet de prendre le contrôle d’un site WordPress

CVE-2026-32475 : un visiteur anonyme peut déposer et exécuter un fichier PHP via un formulaire Elementor Pro. Voici comment protéger votre site WordPress.

Le post Elementor Pro : une faille critique permet de prendre le contrôle d’un site WordPress a été publié sur IT-Connect.