Have you ever been fumbling around, looking for the Bitlocker recovery key but don’t know exactly where to look? – add to that having a user on the phone, anxious to start working.. the struggle is real!
This tool will make it extremely easy to fetch the key regardless if the key is stored in AD or Azure AD – from a single tool.
Prerequisites
First things first.. we need to make sure that we have a couple of prerequisites in-place.
- RSAT (if you have keys stored in AD):
- Install ADDS RSAT feature: Add-WindowsCapability -Online -Name ‘Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0’
- Install Bitlocker RSAT feature: Add-WindowsCapability -Online -Name ‘Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0’
- PowerShell module(s):
- MSAL.PS Install-Module MSAL.PS
- Microsoft.Identity.Client Install-Module Microsoft.Identity.Client
- AZ.Accounts Install-Module AZ.Accounts
Let’s rock enroll!
Register the app
We will use an Azure registered app with delegated permissions to execute our MS Graph calls against. The next steps cover how to create the app and delegate the appropriate permissions.
- Navigate to: https://portal.azure.com
- Click: Azure Active Directory
- Click: App registrations
- Click: New registration
- Name: I will use ‘Demo-Graph‘ but you may name the app differently
- Supported account types: Accounts in this organizational directory only
- Redirect URI (Select a platform): Public client/native (mobile and desktop)
- Redirect URI (URL): https://login.microsoftonline.com/common/oauth2/nativeclient
- Click: Register
- Save the Application (client) ID in notepad, we will need it later
- Click: API Permissions
- Click: Microsoft Graph
- Click: Delegated permissions
- Search for and mark: BitlockerKey.Read.All
- Search for and mark: Device.Read.All
- Search for and mark: DeviceManagementConfiguration.Read.All
- Click: Add permissions
- Click: Grant admin consent for…
- Click: Yes
- Make sure that the permissions have been granted accordingly
- Now navigate to https://aad.portal.azure.com/
- Click: Azure Active Directory
- Save the Tenant ID in notepad, we will need it later
Download the tool
- Download the tool from: NicklasAhlberg/Bitlocker-Recovery-Key-Tool (github.com)
- Make sure you download the latest version from the releases section
- Extract the zip-file and make sure that following three (3) files are in the same directory
- Open: config.txt and paste the clientID and tenantID from notepad
- Save: config.txt
Run the tool
Run the tool by executing: Bitlocker Recovery Key Tool.exe