ClearAllAutoUnlockKeys method of the Win32_EncryptableVolume class

The ClearAllAutoUnlockKeys method of the Win32_EncryptableVolume class removes all external keys and related information saved onto the currently running operating system volume that are used to automatically unlock data volumes.

Syntax

uint32 ClearAllAutoUnlockKeys();

Parameters

This method has no parameters.

Return value

Type: uint32

This method returns one of the following codes or another error code if it fails.

Return code/value Description
S_OK
0 (0x0)
The method was successful.
FVE_E_NOT_ACTIVATED
2150694920 (0x80310008)
BitLocker is not enabled on the volume. Add a key protector to enable BitLocker.
FVE_E_NOT_OS_VOLUME
2150694952 (0x80310028)
The method can only be run for the currently running operating system volume.

 

Remarks

ClearAllAutoUnlockKeys achieves the same functionality as running DisableAutoUnlock for every data volume that has ever been associated with the currently running operating system, even data volumes that are not currently connected to the computer. It also removes any stale unlocking information associated with data volumes that no longer exist.

Before calling Decrypt on the currently running operating system volume, use ClearAllAutoUnlockKeys to ensure that information placed in the operating system registry to automatically unlock data volumes is not accessible in the clear on disk.

After ClearAllAutoUnlockKeys runs successfully, the methods UnlockWithExternalKey or UnlockWithNumericalPassword can be used to unlock all data volumes on this computer. Use EnableAutoUnlock to re-enable automatic unlocking of a data volume.

If no other errors are returned, ClearAllAutoUnlockKeys removes from the registry any volume protector IDs and external keys used to automatically unlock any data volume that has ever been associated with the currently running operating system volume.

Managed Object Format (MOF) files contain the definitions for Windows Management Instrumentation (WMI) classes. MOF files are not installed as part of the Windows SDK. They are installed on the server when you add the associated role by using the Server Manager. For more information about MOF files, see Managed Object Format (MOF).

Requirements

Requirement Value
Minimum supported client
Windows Vista Enterprise, Windows Vista Ultimate [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Namespace
Root\CIMV2\Security\MicrosoftVolumeEncryption
MOF
Win32_encryptablevolume.mof

See also

Win32_EncryptableVolume