How to relock a Bitlocker drive after you've unlocked it with PowerShell

If you're using Windows Server 2012 or above you can use PowerShell to relock a bitlocker drive that you have already unlocked

Lock-BitLocker E:

However if the drive is in use you may see this error

Lock-BitLocker : Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED))
At line:1 char:1
+ Lock-BitLocker E:
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], UnauthorizedAcc
   essException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Lock-BitLocke
   r
 

This is simple to resolve - simply add the -ForceDismount parameter
Lock-BitLocker E: -ForceDismount  



Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations