Skip to main content

Initialize and Audit BitLocker

Description​

Applies the BitLocker configuration set in the cPVAL custom fields to the drive in cPVAL MountPoint, then records the BitLocker, Secure Boot and TPM status of the device in NinjaOne custom fields. It runs as the automation of the Enable BitLocker - Laptop, Enable BitLocker - Desktop and Enable BitLocker - Server compound conditions when BitLocker Initialization - Detection reports a needed fix, and can also be run on demand.

The automation checks the drive in the same order as the detection script and takes the first action that applies:

Drive stateAction
Decrypting, or waiting for the BitLocker hardware test at the next restartNone
Not encryptedEncrypts the drive with the configured settings
Force is checked and the drive is not encryptingTurns BitLocker off and encrypts the drive again
System drive protected only by a recovery password, recovery key or Active Directory accountAdds a TPM protector without decrypting, then turns protection on
A different TPM based protector or encryption method than configuredTurns BitLocker off and encrypts the drive again
Encrypted without key protectors (Windows device encryption waiting for activation)Adds the key protectors and turns protection on
Configured protector missing, encryption paused, or protection suspended until resumed manuallyFixes it without decrypting
Matches the configuration, or protection suspended for a set number of restartsNone

After turning BitLocker off, the automation waits up to 15 minutes for decryption. When decryption finishes in time, the drive is encrypted again in the same run. Otherwise, the next detection run encrypts it once decryption completes. The drive is unprotected until then, and BitLocker is only turned off when the TPM needed to encrypt again is present and ready.

The encryption itself is done by the Initialize-BitLockerVolume script, which the automation downloads from the ProVal content repository and runs only when it carries a valid ProVal signature. The automation verifies its own signature first. When either check fails, it stops before changing the drive or the custom fields.

At the end of every run, successful or not, apart from one stopped by a failed signature check, the automation writes the same custom fields as BitLocker and TPM Audit. The drive's recovery passwords are therefore in cPVAL BitLocker Info even when the device restarts before they reach Active Directory or Microsoft Entra ID.

note
  • RecoveryPassword, RecoveryKey and AdAccount cannot unlock the system drive at startup by themselves, so the automation always adds a TPM protector alongside them on that drive. When the TPM is missing, or not ready and cPVAL Allow TPM Or Reboot does not allow initializing it, the drive is left unchanged.
  • Windows Home editions are not supported. Servers need the BitLocker Drive Encryption feature.
  • When cPVAL MountPoint is blank, the system drive is used.

Requirements​

  • Windows PowerShell 5.1, run as System.
  • Access to contentrepo.net.
  • The custom fields listed below, including cPVAL TPM Info.

Sample Run​

SampleRun

Dependencies​

Custom Fields​

Field LabelScopeAccepted ValuesDefault ValueDescription
cPVAL MountPointOrganization, Location, DeviceA drive letter: D, D: or D:\System driveThe drive to enforce BitLocker on.
cPVAL EncryptionMethodOrganization, Location, DeviceAes128, Aes256, XtsAes128, XtsAes256XtsAes128The encryption method. A drive encrypted with another method is decrypted and encrypted again.
cPVAL KeyProtectorTypeOrganization, Location, DeviceTpm, TpmPin, TpmStartup, TpmPinStartup, Password, Startup, RecoveryKey, RecoveryPassword, AdAccountRecoveryPasswordThe key protector. RecoveryPassword, RecoveryKey and AdAccount also get a TPM protector on the system drive.
cPVAL PIN Or PasswordOrganization, Location, DeviceA PIN, a password, or a 48-digit recovery password-Required for TpmPin, TpmPinStartup and Password. Optional recovery password for RecoveryPassword.
cPVAL Path Or ADAccountOrganization, Location, DeviceA folder path, or a domain account or group-Required for TpmStartup, TpmPinStartup, Startup, RecoveryKey and AdAccount.
cPVAL Allow TPM Or RebootOrganization, Location, Device0 = None, 1 = Initialize the TPM, 2 = Restart, 3 = Both0Whether the automation may initialize the TPM and restart the device.
cPVAL SkipHardwareTestOrganization, Location, DeviceChecked or uncheckedUncheckedStarts encryption without the hardware test at the next restart.
cPVAL BitLocker InfoDeviceWritten by the automation-Every BitLocker volume and key protector, including recovery passwords.
cPVAL BitLocker Enabled for System DriveDeviceWritten by the automation-Checked when the system drive has a key protector.
cPVAL TPM InfoDeviceWritten by the automation-TPM details.
cPVAL Audit fields of BitLocker and TPM AuditDeviceWritten by the automation-Optional. Written when they exist; the run does not fail without them.

Parameters​

NameTypeDescription
ForceCheckboxTurns BitLocker off on an encrypted drive and encrypts it again with the settings from the custom fields. The drive is unprotected while it decrypts.

Automation Setup/Import​

Automation Configuration

Output​

Changelog​

2026-10-26​

  • Renamed the automation from Initialize BitLocker to Initialize and Audit BitLocker.
  • A system drive protected only by a recovery password, recovery key or Active Directory account now gets a TPM protector before protection is turned on, and is left unchanged when the TPM cannot be used.
  • The drive is checked in the same order as the detection script. Missing protectors, Windows device encryption waiting for activation, paused encryption and suspended protection are fixed without decrypting.
  • BitLocker is turned off only when the TPM needed to encrypt again is ready, and encryption no longer starts while the drive is still decrypting.
  • The signatures of the automation and the Initialize-BitLockerVolume script are verified before anything runs.
  • The automation writes the same custom fields as BitLocker and TPM Audit, including cPVAL TPM Info.
  • Moved the Force parameter to this document, and removed the output screenshots, which the custom field documents show.

2025-12-16​

  • Initial version of the document