Simplifying BitLocker: Enable and Store Recovery Keys Without User Input | Nischal Gautam
Nischal Gautam

Simplifying BitLocker: Enable and Store Recovery Keys Without User Input

BitLocker is one of the easiest ways to protect data on Windows machines — especially in a company or school where laptops might get lost or stolen. But if you’ve ever tried to roll it out using just Group Policy (GPO), you probably ran into a common problem: it doesn’t actually turn on BitLocker by itself.

Yep, GPO can configure BitLocker settings, but it won’t flip the switch without some sort of user interaction — which is a pain when you’re managing dozens or hundreds of computers.

I needed a way to automatically enable BitLocker, without user input, and also make sure the recovery keys were safely backed up to Active Directory (AD). So, i wrote a simple script that takes care of all that — and I run it using Task Scheduler.

Let’s break it all down.


What This Setup Does

Here’s what I wanted to achieve:

It sounds like a lot, but with the right GPO settings and a small script, it’s actually pretty straightforward.


Why Not Just Use GPO?

I tried. The problem is, GPO only sets the policies — it doesn’t actually enable encryption on its own. You still need the user to click through the BitLocker wizard, which isn’t ideal in a managed environment.

I have a script solves that problem by:


Step 1: Install the BitLocker Feature

Make sure BitLocker is installed on your devices. You can push this via GPO, or run this PowerShell command manually or through a deployment tool:

Enable-WindowsOptionalFeature -Online -FeatureName BitLocker -All

Or enable through Server Manager bitlocker_feature.png

Step 2: Set the Right GPOs

Now configure Group Policy so that BitLocker works the way you want and backs up recovery keys to Active Directory automatically.

These are the main GPO settings i used:


🔒 1. Store BitLocker recovery information in Active Directory

GPO Path:
Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption

store_bitlocker.png

What to do:

enable_bitlocker.png


🛡 2. Choose how BitLocker-protected operating system drives can be recovered

GPO Path:
Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives

What to do:

bitlocker_option.png


💽 3. Enforce drive encryption type on operating system drives

GPO Path:
Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives

What to do:

This makes sure encrypt the whole system drive. encryption_option.png


Step 3: Use the Script

This is where the real shit happens. Since GPO can’t turn on BitLocker automatically without user input, I use a simple script to do it silently.

The script does three key things:

  1. Checks if BitLocker is already enabled
  2. Enables it if it’s not
  3. Uploads the recovery key to Active Directory (even if BitLocker was already enabled manually)

🔧 Script Overview

This ensures all machines are encrypted and recovery info is safely stored, no matter how BitLocker was turned on.


📂 Get the Script

👉 You can view or download the script from my GitHub repo:
https://github.com/akamasine/dotfiles-n-tools/blob/main/Windows/bitlocker-key-sync.bat


✅ What You’ll Need


💡 Tip: Test the script in a virtual lab or on a test device before pushing to all systems.

Step 4: Automate the Script Using Task Scheduler via GPO

To run the BitLocker script automatically on every machine, we deploy a Scheduled Task using Group Policy (GPO). This lets us run the script silently at startup.


🧭 GPO Path

Group Policy Management Console (GPMC):
Computer Configuration > Preferences > Control Panel Settings > Scheduled Tasks

scheduled_tasks.png


⚙️ Scheduled Task Configuration

Right-click > New > Scheduled Task (At least Windows 7) Configure as follows:

Step 5: Linking the GPO

After configuring your GPO with the scheduled task and BitLocker settings, you need to link it to the correct Organizational Unit (OU) in Active Directory. This ensures only the intended computers receive the policy.

How to link the GPO:

  1. Open Group Policy Management Console (GPMC).
  2. Find the OU containing your target computers (for example, OU=Workstations).
  3. Right-click the OU and select Link an Existing GPO.
  4. Choose your BitLocker GPO from the list and click OK.

💡 Tip: If you have multiple OUs (e.g., for laptops and desktops), link the GPO to each relevant OU as needed.

Verify GPO application:


By linking the GPO to the right OU, you ensure that BitLocker is automatically enabled and managed on all required devices, with minimal manual intervention.

Conclusion

With the right GPO settings and a simple automation script, you can silently enable BitLocker and ensure recovery keys are safely stored in Active Directory—no user action required. This approach streamlines device encryption across your organization, reduces manual effort, and keeps your data protected. Test thoroughly, monitor deployment, and enjoy hassle-free BitLocker management!