Share via


Bitlocker CLI error

Question

Tuesday, May 12, 2020 7:33 AM

Can anyone please explain why this command will not work?  I'm so close to finally scripting this but this error is driving me nuts!

$SecureString=ConvertTo-SecureString "Test1234567" –asplaintext –force
Enable-BitLocker -MountPoint "C:" -UsedSpaceOnly -Pin $SecureString -TPMandPinProtector -SkipHardwareTest -RecoveryKeyPath "e:\" -RecoveryKeyProtector

(Get-BitLockerVolume -MountPoint C).KeyProtector.recoverypassword > c:\bitlockerkey.txt

The error is:

Enable-BitLocker : Parameter set cannot be resolved using the specified named parameters.
At C:\Users\Admin\Desktop\bitlocker.ps1:9 char:1

  • Enable-BitLocker -MountPoint "C:" -UsedSpaceOnly -Pin $SecureString - ...

    + CategoryInfo          : InvalidArgument: (:) [Enable-BitLocker], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Enable-BitLocker

All replies (3)

Wednesday, May 13, 2020 4:30 AM

Hi Karl,

 

Do you want to enable BitLocker drive encryption via the command prompt, if yes ,you should evoke  manage-bde command. Refer to the link below:

 

/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff829849(v=ws.11)?redirectedfrom=MSDN

 

BitLocker encryption can also be done through BitLocker control panel and Windows Explorer.

 

Best regard,

Sylvia

 

 

Please remember to mark the replies as answers if they help. "Windows 10 Installation, Setup, and Deployment" forum will be migrating to a new home on Microsoft Q&A (Preview)! We invite you to post new questions in the "Windows 10 Installation, Setup, and Deployment" forum’s new home on Microsoft Q&A (Preview)! For more information, please refer to the sticky post.


Wednesday, May 13, 2020 5:35 AM

So what's the difference between Manage-BDE and Powershell commands?  I'm already building out a lot of my scripts in powershell.  Why choose Manage-BDE?  From what i understood, they seem about the same for the advanced configurations of Bitlocker.


Thursday, May 14, 2020 8:41 AM

Hi,

I suppose there may be a string missing from your command which is -EncryptionMethodf

Here is an example for you:

$SecureString = ConvertTo-SecureString "1234" -AsPlainText -Force
Enable-BitLocker -MountPoint "C:" -EncryptionMethod Aes256 -UsedSpaceOnly -Pin $SecureString -TPMandPinProtector

You can also get more advice by visiting the link:

/en-us/powershell/module/bitlocker/enable-bitlocker?view=win10-ps

Please let us know if you would like further assistance.

Really hope that will help you.

Best wishes,

Young Yang

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].