Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UnlockWithExternalKey Method
Collapse the table of content
Expand the table of content

UnlockWithExternalKey method of the Win32_EncryptableVolume class

The UnlockWithExternalKey method of the Win32_EncryptableVolume class uses a provided external key to access the contents of a data volume.

The volume's encryption key must have been secured with one or more key protectors of the type "External Key" using the ProtectKeyWithExternalKey method to be able to unlock the volume with this method.

Note  If the disc supports hardware encryption this function sets the band status to "unlocked""


uint32 UnlockWithExternalKey(
  [in] uint8 ExternalKey[]


ExternalKey [in]

Type: uint8[]

An array of bytes that specifies the 256-bit external key used to unlock the volume. This key can be obtained by calling the GetExternalKeyFromFile method.

Return value

Type: uint32

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

If the volume is already unlocked, this method returns 0.

Return code/valueDescription
0 (0x0)

The method was successful.

No value given (0x)

The volume does not have a key protector of the type "External Key".

No value given (0x)

One or more key protectors of the type "External Key" exist, but the specified ExternalKey parameter cannot unlock the volume.

2147942487 (0x80070057)

The ExternalKey parameter is not an array of size 4.

2150694920 (0x80310008)

BitLocker is not enabled on the volume. Add a key protector to enable BitLocker.



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).


Minimum supported client

Windows Vista Enterprise, Windows Vista Ultimate [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]





See also




Community Additions

© 2015 Microsoft