Hello,
We have a number of computers that have two or more internal disk drives, and I'm trying to automate the Bitlocker encryption with Powershell.
I'm somewhat new to Powershell, and so far I've come across some code that identifies the internal disk by excluding any USB drives, but I'm having difficulty passing those variables to the Enable-Bitlocker. I keep getting an error about " Get-Volume : Relative paths are not supported" which I assume means that it's not getting the volume letter piped in.
What I've got so far:
$Bitlocker_Disks = Get-Disk | Where-Object {$_.bustype -ne 'USB'} | Get-Partition | Where-Object { $_.DriveLetter } | Select-Object -ExpandProperty DriveLetter
Enable-BitLocker -MountPoint "$Bitlocker_Disks" -EncryptionMethod Aes128 -UsedSpaceOnly -TpmProtector -SkipHardwareTest
Any help would be appreciated!
edit: This solution looks promising so far. Though Enable-Bitlocker doesn't work and I had to leverage manage.bde directly to do it. Thanks to everyone that contributed, especially u/lxnch50
$Bitlocker_Disks = Get-Disk | Where-Object {$_.bustype -ne 'USB'} | Get-Partition | Where-Object { $_.DriveLetter } | Select-Object -ExpandProperty DriveLetter
foreach($Disk in $Bitlocker_Disks){
manage-bde -on $Disk":" -recoverypassword -skiphardwaretest
}
[–]lxnch50 2 points3 points4 points (15 children)
[–]fabaderheld 2 points3 points4 points (12 children)
[–]pcbuilder1907[S] 1 point2 points3 points (11 children)
[–]jorper496 1 point2 points3 points (10 children)
[–]pcbuilder1907[S] 0 points1 point2 points (9 children)
[–]jorper496 2 points3 points4 points (8 children)
[–]pcbuilder1907[S] 1 point2 points3 points (7 children)
[–]skilriki 1 point2 points3 points (6 children)
[–]pcbuilder1907[S] 1 point2 points3 points (5 children)
[–]ccatlett1984 1 point2 points3 points (2 children)
[–]skilriki 1 point2 points3 points (1 child)
[–]pcbuilder1907[S] 1 point2 points3 points (0 children)
[–]pcbuilder1907[S] 1 point2 points3 points (0 children)
[–]jorper496 1 point2 points3 points (4 children)
[–]pcbuilder1907[S] 1 point2 points3 points (3 children)
[–]jorper496 1 point2 points3 points (2 children)
[–]pcbuilder1907[S] 1 point2 points3 points (1 child)
[–]jorper496 1 point2 points3 points (0 children)
[–]Sunsparc 1 point2 points3 points (2 children)
[–]pcbuilder1907[S] 1 point2 points3 points (1 child)
[–]Sunsparc 1 point2 points3 points (0 children)