|
This Guide shows example commands on how to deal with Bitlocker. The first command below will let you see if it is enabled or not.
Check the status of Bitlocker Encryption on a computer: Copy to Clipboard
manage-bde -statusShow the recovery key for the C: drive: Copy to Clipboard
manage-bde -protectors C: -getMicrosoft link to see all recovery keys: https://go.microsoft.com/fwlink/p/?LinkId=237614 - Example of what it will look like
Lock a bitlocker drive: Copy to Clipboard
manage-bde -lock d: -ForceDismountRepair a damaged Bitlocker volume: Copy to Clipboard
repair-bde /?Copy to Clipboard
repair-bde d: e:\backup.img /forceDecrypt a Bitlocker volume: Copy to Clipboard
manage-bde c: -offDell Computer asking for Bitlocker without notification - You may be able to change a BIOS setting back which will make the computer stop asking for the bitlocker key Try enabling UEFI/Secure Boot, PTT in BIOS. https://www.wintips.org/fix-dell-laptop-needs-the-bitlocker-recovery-key/ Auto unlock a drive using a batch file. This has security implications, ensure you do this safely! These all need to run as admin 1: Create an unlock file in C:\ that will be able to unlock the D: bitlocker protected drive: Copy to Clipboard
manage-bde -protectors -add d: -rk c:\2: Find the new file that was created. It will look like 'C:\123AB123-1A23-78BC-941A-J019014322A0.BEK' Copy to Clipboard
dir C:\ /a3: Unlock the D: Drive. Copy to Clipboard
manage-bde -unlock d: -rk C:\123AB123-1A23-78BC-941A-J019014322A0.BEKBatch file to check if Bitlocker is enabled on a computer, and save the recovery keys if it is. Save this as a .bat file and run it. Copy to Clipboard
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
manage-bde -protectors C: -get > C:\bitlocker.txt
set findstr=No key protectors found
>nul findstr /c:"%findstr%" C:\bitlocker.txt && (
echo Bitlocker is not enabled. Closing this window in 10 seconds.
del C:\bitlocker.txt
timeout 10
) || (
color 0c
echo Bitlocker is enabled!
echo The recovery has been saved to this file, and is shown below.
echo C:\bitlocker.txt
echo.
echo.
type C:\bitlocker.txt
pause
)
|