1

I am playing around trying to learn the Win32_EncryptableVolume class functionality (https://learn.microsoft.com/en-us/windows/win32/secprov/win32-encryptablevolume). I have created a VM for the purpose and secured it using a simple Bitlocker password (no TPM).

I have created a the following PowerShell script. I know that the Key Protector ID is correct (verified using GetKeyProtectors and from that file Bitlocker prints with the recover key file Bitlocker creates).

# Namespace is per the Microsoft documentation
$wmi = Get-WmiObject -Namespace "ROOT\CIMV2\Security\MicrosoftVolumeEncryption" -Class Win32_EncryptableVolume

$keyProtectorID = "{C0B908CA-CC22-4A65-B61E-3257D4B5176C}"
#Folder path is only the folder, not the actual filename as specified in the documentation
$folderPath = "C:\tmp"
Invoke-WmiMethod -InputObject $wmi -Name SaveExternalKeyToFile -ArgumentList $keyProtectorID, $folderPath

#Output is as follows:

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 2147746291
PSComputerName   :

WinErr gives the following output for error 2147746291:

# for decimal -2147221005 / hex 0x800401f3
  CO_E_CLASSSTRING                                               winerror.h
# Invalid class string
# 1 matches found for "2147746291"

I'm not sure how the class string is incorrect?

0

You must log in to answer this question.

Browse other questions tagged .