Skip to content

Instantly share code, notes, and snippets.

@psitem
Created February 17, 2025 08:13
Show Gist options
  • Save psitem/58b2fa72f45c17494fdc51a0a13c6baa to your computer and use it in GitHub Desktop.
Save psitem/58b2fa72f45c17494fdc51a0a13c6baa to your computer and use it in GitHub Desktop.
Backup BitLocker recovery keys to Active Directory
Get-BitLockerVolume | `
Where-Object { $_.VolumeStatus -like "FullyEncrypted" } | `
ForEach-Object {
foreach( $Key in $_.KeyProtector ) {
if( $Key -like "RecoveryPassword" ) {
Backup-BitLockerKeyProtector -MountPoint $_.mountpoint -KeyProtectorId $key.KeyProtectorId
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment