Skip to content

Commit

Permalink
added recovery password set
Browse files Browse the repository at this point in the history
  • Loading branch information
redanthrax committed Mar 19, 2024
1 parent a637392 commit 27c365f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts_wip/Win_ManageBitlocker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ function Win_ManageBitlocker {
else {
Write-Output "Volume already encrypted or in process"
}

#Check for recovery password, add if missing
$recoveryPassword = $vol.KeyProtector | Where-Object { $_.KeyProtectorType -eq "RecoveryPassword" }
if (-Not($recoveryPassword)) {
Write-Output "Adding recovery password"
$vol | Add-BitLockerKeyProtector -RecoveryPasswordProtector -InformationAction SilentlyContinue | Out-Null
}
}
}
}
Expand Down

0 comments on commit 27c365f

Please sign in to comment.