DisableAutoUnlock method of the Win32_EncryptableVolume class

The DisableAutoUnlock method of the Win32_EncryptableVolume class removes the external key saved onto the currently running operating system volume so that a data volume is not automatically unlocked when it is mounted, such as when removable memory devices are connected to the computer.

If automatic unlocking is disabled or suspended, the methods UnlockWithExternalKey or UnlockWithNumericalPassword must be used to unlock the volume.

Syntax

uint32 DisableAutoUnlock();

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_VOLUME_NOT_BOUND
2150694935 (0x80310017)
Automatic unlocking on the volume is disabled.
FVE_E_NOT_ACTIVATED
2150694920 (0x80310008)
BitLocker is not enabled on the volume. Add a key protector to enable BitLocker.
FVE_E_NOT_DATA_VOLUME
2150694937 (0x80310019)
The method cannot be run for the currently running operating system volume.

 

Remarks

If no errors are returned, this method removes from the registry any volume protector IDs and external keys used to automatically unlock the 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