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
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
Post a Comment