How do I get a list of all our bitlocker keys already in Azure?

Allan, Robyne 70 Reputation points
2023-06-14T21:18:23.74+00:00

We want to enable stale device clean up in Azure but the Microsoft articles state we need to get the list of bitlocker keys before we enable the clean up. We have tried several scripts with no luck. I am an Intune Administrator and my teammate is a Global Admin but we still get errors (one is we are not authorized) in the scripts we have tried. I would like a simple way of getting the bitlocker keys saved to an excel file so we can keep that on hand before doing the clean up. Any suggestions would be appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,631 questions
{count} votes

Accepted answer
  1. Vasil Michev 100.2K Reputation points MVP
    2023-06-15T15:54:56.4733333+00:00

    Not sure what script you have been playing with, but getting the list is pretty straightforward via the Graph API: https://learn.microsoft.com/en-us/graph/api/bitlocker-list-recoverykeys?view=graph-rest-1.0

    If you prefer doing it via PowerShell, you can use the Graph SDK for PowerShell and the following cmdlets:

    Connect-MgGraph -Scopes BitLockerKey.Read.All
    Get-MgInformationProtectionBitlockerRecoveryKey -All
    
    4 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. eli sorow 46 Reputation points
    2023-11-22T11:21:31.4833333+00:00

    Hello,

    is there anyway to have the information : key presence per device ?

    the Get bitlockerRecoveryKey cmdlet does not help

    the goal is to get devices that have not the bitlocker key in azure

    having all devices and the key will be helpfull to get device with missing key.

    thank you for your help

    BR

    Eli

    0 comments No comments

  2. Allan, Robyne 70 Reputation points
    2024-01-15T20:31:36.21+00:00

    Vasil helped us resolve our issue. Here is the script that worked for us to get all the bitlocker keys from Azure. Import-Module Microsoft.Graph.Identity.DirectoryManagement Connect-MgGraph -Scopes "bitlockerkey.readbasic.all", "bitlockerkey.read.all" -TenantId xxxxxxxxxxxxx Get-MgInformationProtectionBitlockerRecoveryKey -all | select Id,CreatedDateTime,DeviceId,@{n="Key";e={(Get-MgInformationProtectionBitlockerRecoveryKey -BitlockerRecoveryKeyId $_.Id -Property key).key}},VolumeType | export-csv c:\tmp\bitlocker.csv

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more