2

I am trying to encrypt Data volume (for example E:) with the following command:

manage-bde -protectors -add E: -pw

When I execute the above command, it will ask for the password, so I entered it. It is successfully encrypting my data volume. Now, I want to make a script to encrypt a data volume, so I need to pass the password as an argument to the above powershell command.

How can I do that? Is there any option of passing the password for manage-bde command?

Pydev
  • 43
  • 1
  • 3
  • Be aware that `manage-bde` is a command line executable and not a PowerShell cmdlet (although it tries to emulate PowerShell's parameter syntax) - and according to the documentation, `manage-bde` does not seem to support scripted password inputs, even the `-changepassword` context prompts for the password interactively :( – Mathias R. Jessen May 12 '15 at 11:37
  • There is no option of achieving this? :( – Pydev May 12 '15 at 12:05

1 Answers1

2

If you're working on Windows Server 2012 or newer, you can use the BitLocker cmdlets:

Add-BitLockerKeyProtector -MountPoint "E:" -Password ("Password" | ConvertTo-SecureString -AsPlainText -Force) -PasswordProtector

The Add-BitLockerKeyProtector cmdlet accepts the password in the form of a SecureString object, which is why we pipe the plaintext "Password" to ConvertTo-SecureString

Mathias R. Jessen
  • 25,161
  • 4
  • 63
  • 95
  • I am using Windows 7, is there any option of achieving the same on windows 7? – Pydev May 12 '15 at 12:04
  • @SureshKota Sorry, the PowerShell module is not available on Windows 7 according to this [RSAT support matrix](http://social.technet.microsoft.com/wiki/contents/articles/2202.remote-server-administration-tools-rsat-for-windows-client-and-windows-server-dsforum2wiki.aspx#RSAT_Platform_and_Tools_Support_Matrix) – Mathias R. Jessen May 12 '15 at 15:09