How I made useful scripts to Unlock, Lock, Pause and Resume Bitlocker locked disks.

Simple Scripts to handle locking and unlocking

Scripts to Unlock Lock Pause and Resume BitLocker Encryption

Have you got many hard disks? Want to use Bitlocker but unlocking each disks one by one takes a lot of time? Here is a quick guide to working scripts and commands for saving you days of work trying to work it out.

Please note that you need to run scripts as Administrator (right click and run as administrator). You also need to use the same BitLocker password on the disks to make it unlock them all with a single password entry using these scripts. Setting the passwords is something you do in Manage BitLocker in the Windows 10 Control Panel (BitLocker may also be available in some versions of Windows 8).

All scripts have been run and tested in Windows 10. Be careful & try these scripts at your own risk, we take no responsibility for any damages! I have been running these scripts for a few weeks now and it truly does save me a lot of time, unlocking 10 disks automatically.

Below are .cmd scripts and one .ps1 script that help you do the following actions without manually using the Manage BitLocker interface:

  • Lock BitLocked disks
  • Pause encryption of disks with BitLocker
  • Resume encryption of disks with BitLocker
  • Unlock all disks locked with BitLocker

Create a .cmd script to Lock All Drives that have BitLocker On: “lock-all-drives.cmd”

Example content of the script “lock-all-drives.cmd”, add as many disks as you have bitlocked:

manage-bde -lock D:
manage-bde -lock E:
manage-bde -lock F:
etc…

Create a .cmd script to Pause all BitLocker Encyrpting… in Progress: “pause-all-drives.cmd”

Content of the script “pause-all-drives.cmd”, add as many disks as you have bitlocked or are bitlocking:

manage-bde -pause D:
manage-bde -pause E:
manage-bde -pause F:
etc…

Create a .cmd script to Resume all BitLocker Encrypting… in Progress: “resume-all-drives.cmd”

Content of script “resume-all-drives.cmd”, again add as many disks as you have / are bitlocking:

manage-bde -resume D:
manage-bde -resume E:
manage-bde -resume F:
etc…

Create a simple .cmd script to run a PowerShell Script that allows Unlocking all your disks locked with BitLocker”: “PipeScript.cmd”

This one is a huge time saver if you have many disks, as otherwise you would have to painfully unlock every single drive manually in Windows. Very slow and time consuming!

Please note that this script is for running a PowerShell Script, that we are creating after this one. The “PiperScript.cmd” allows us to execute a PowerShell script automatically.

Please change the path ‘c:\Users\YourUserName\Scripts\Unlock-Script.ps1’ in the script below to the location where you have saved your script.

Content example of script “PipeScript.cmd”:

powershell -command -<
c:\Users\YourUserName\Scripts\Unlock-Script.ps1

Create a PowerShell Script to ask for your a password and then unlock all drives automatically: “Unlock-Script.ps1”

Content of script “Unlock-Script.ps1”:

$key = Read-Host ‘Enter BitLocker Password!’ -
AsSecureString
Unlock-BitLocker -MountPoint “D:” -Password $key
Unlock-BitLocker -MountPoint “E:” -Password $key
Unlock-BitLocker -MountPoint “F:” -Password $key
Unlock-BitLocker -MountPoint “G:” -Password $key
Unlock-BitLocker -MountPoint “H:” -Password $key
etc…

My Summary

Above are .cmd scripts and one .ps1 script that help you do the following actions without manually using the Manage BitLocker interface:

  • Lock bitlocked disks
  • Pause encryption of disks with BitLocker
  • Resume encryption of disks with BitLocker
  • Unlock all disks locked with BitLocker

That’s it. Enjoy this method of handling locking and unlocking BitLocked disks with scripts!

Anders Sundstedt

Need an animated video for your website, facebook, twitter or blog? Contact us to get a free quote and discuss your project. Quick response, work directly with creative. No outsourcing to cheaper studios: http://sundstedt.se

Originally published at Sundstedt Animation, sundstedt.se on November 24, 2015.