diff --git a/scripts_wip/Win_ManageBitlocker.ps1 b/scripts_wip/Win_ManageBitlocker.ps1 index 00dc917..50b7fd0 100644 --- a/scripts_wip/Win_ManageBitlocker.ps1 +++ b/scripts_wip/Win_ManageBitlocker.ps1 @@ -139,9 +139,10 @@ function Win_ManageBitlocker { Write-Output "Volume already encrypted or in process" } - #Check for recovery password, add if missing + #Check for recovery password, add if missing and we have Tpm + $tpmProtector = $vol.KeyProtector | Where-Object { $_.KeyProtectorType -eq "Tpm" } $recoveryPassword = $vol.KeyProtector | Where-Object { $_.KeyProtectorType -eq "RecoveryPassword" } - if (-Not($recoveryPassword)) { + if (-Not($recoveryPassword) -and $tpmProtector) { Write-Output "Adding recovery password" $vol | Add-BitLockerKeyProtector -RecoveryPasswordProtector -InformationAction SilentlyContinue | Out-Null }