当前Bitlocker密钥在Entra ID门户中,需要根据Bitlocker密钥ID进行搜索。
而在Intune门户中,需要单台设备查询。
1.请参考以下官方文档中的步骤创建一个application。
https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph
2.在App registrations中找到对应的application,然后找到Certificates&secrets – New client secret,创建一个secret,并记录Value的值。
3.在API permissions中添加BitlockerKey.Read.All的权限。
4.安装graph的Module
Install-Module Microsoft.Graph -Scope AllUsers -Repository PSGallery -Force
5. 参考以下命令使用应用登录,请将黄色背景部分替换为您环境中的值。
$ClientSecretCredential = Get-Credential -Credential "应用的Application ID"
##运行上命令后,会弹出输入Password的窗口,请输入第2步中记录的secret的Value。
Connect-MgGraph -Environment China -TenantId "租户ID" -ClientSecretCredential $ClientSecretCredential
6.最后使用以下命令导出Bitlocker Recovery Key
Get-MgInformationProtectionBitlockerRecoveryKey -All | select Id,CreatedDateTime,DeviceId,@{n="Key";e={(Get-MgInformationProtectionBitlockerRecoveryKey -BitlockerRecoveryKeyId $_.Id -Property key).key}},VolumeType | Export-Csv .\bitlockerkey.csv
结果类似以下截图:
建议您同时导出Entra ID中的设备信息,以便通过DeviceID查询其他信息,如设备名称等。

