VisualStudioIf you have configured your BitLocker Drive Encryption to back up recovery information for BitLocker-protected drives and the Trusted Platform Module (TPM) to Active Directory Domain Services (AD DS) the backed up BitLocker recovery information is stored in a child object of the computer object. That is, the computer object is the container for a BitLocker recovery object. Each BitLocker recovery object includes the recovery password and other recovery information.

Here is an example in VB.NET that will list all computer objects in the AD and it’s corresponding recovery password.

The first step is to reference the Directory Services name space

Then declare the Bitlocker Structure. This structure will be used to hold various Bitlocker data as it is passed back to the main function from the ReturnRecoveryKey function.

Now that the structure is defined we want to create the main function. This code will loop through and enumerate all computer objects for the default domain. Then for each computer object it finds, it calls the ReturnRecoveryKey function which checks the msFVE-RecoveryInformation if there is Bitlocker information available and returns this as a BitlockerInfo structure.

Lastly, we need to create the ReturnRecoveryKey function. This is the function that takes a computer objects LDAP string as input variable and returns Bitlocker information for that specific computer object.

Download Bitlocker Example (VB.NET, Visual Studio 2010)