Bitlocker using win 32 api

Amal Krishna Jk 25 Reputation points
2025-06-17T09:35:03.1833333+00:00

I have created a function inside my agent to apply bitlocker on a drive using win api, even though the execution is completed successfully the drives are not getting locked using bitlocker

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Omkara Varshitha Kunapalli (INFOSYS LIMITED) 80 Reputation points Microsoft External Staff
    2025-07-03T11:35:54.9633333+00:00

    Issue;

    The function using Windows API to apply BitLocker executes successfully, but the drive remains unencrypted.

     

    Resolution Steps;

    1. Add a key protector; Ensure at least one key protector (e.g., TPM, password, recovery key) is added before invoking encryption methods. Without this, encryption will not proceed.
    2. Validate Drive Format; Confirm the target drive is formatted as NTFS and is not a network drive, as BitLocker supports only NTFS volumes.
    3. Check Encryption Status;  Use  GetConversionStatus and GetProtectionStatus methods from the Win32_EncryptableVolume WMI class to verify if encryption has started or completed.
    4. TPM Initialization; If using TPM-based protection, verify that the TPM is initialized and ready using the Win32_Tpm WMI class.
    5. Review Logs and Return Codes; Even if the function returns success, check system logs for any warnings or unmet prerequisites that may have prevented encryption
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.