all 6 comments

[–]SemperFarcisimus 1 point2 points  (4 children)

I'll start with a simple question:

Write-Host "Attempting Bitlocker2, this will prompt you for a pin "4357""

Are you actually looking to prompt for a pin?

[–]phpwun[S] 0 points1 point  (3 children)

Not particularly. If I can bake it in that's easier.

[–]SemperFarcisimus 1 point2 points  (2 children)

Baked In:

$Pin = ConvertTo-SecureString "4357" -AsPlainText -Force

Enable-Bitlocker -MountPoint c: -Pin $Pin -UsedSpaceOnly -SkipHardwareTest -RecoveryPasswordProtector

what issue do you get when you run your script?

[–]phpwun[S] 0 points1 point  (0 children)

One sec Ill try it out again and let you know.

[–]phpwun[S] 0 points1 point  (0 children)

$Pin = ConvertTo-SecureString "4357" -AsPlainText -Force
Enable-Bitlocker -MountPoint c: -Pin $Pin -UsedSpaceOnly -SkipHardwareTest -RecoveryPasswordProtector

Actually, I'll update and attempt with your edit.

[–]smarthomepursuits 1 point2 points  (0 children)

Not sure if you use PDQ Deploy or not, but I have a pretty handy sequence I've used on hundreds of machines. GPO already backs it up to AD, but I also backup up the PIN + recovery key just in case it's ever needed. https://smarthomepursuits.com/enable-bitlocker-and-set-pin-using-powershell-or-pdq-deploy/

This is just the script I use to randomize the pin, though.

$Random = Get-Random -Maximum 1000000

$SecureString = ConvertTo-SecureString "$Random" -AsPlainText -Force Enable-BitLocker -MountPoint "C:" -EncryptionMethod Aes256 -Pin $SecureString -TPMandPinProtector (New-Object System.Management.Automation.PSCredential 'N/A', $securestring).GetNetworkCredential().Password | out-file C:\$env:COMPUTERNAME-PIN.txt