$userId = "user@example.com" Get-MgUserOwnedDevice -UserId $userId | Where-Object $_.OperatingSystem -eq "Windows" | ForEach-Object Get-MgDevice -DeviceId $_.DeviceId function Get-BitLockerRecoveryKey param([string]$ComputerName) # Try AD first try $key = Get-ADObject -Filter "Name -like '*$ComputerName*' -and objectClass -eq 'msFVE-RecoveryInformation'" ` -Properties msFVE-RecoveryPassword -ErrorAction Stop if ($key) return $key.msFVE-RecoveryPassword catch Write-Warning "AD lookup failed"

# Fallback to Entra ID try Connect-MgGraph -Scopes "Device.Read.All" -NoWelcome $device = Get-MgDevice -Filter "displayName eq '$ComputerName'" return $device.BitLockerKey catch Write-Warning "Entra ID lookup failed"

Sales Questions

Sales Questions

For any sales questions please e-mail us at [email protected]

Sales Questions

Technical Support

For any technical questions please e-mail us at [email protected]

Get in touch and request a quote


Contact Us