
私はWin32_EncryptableVolumeクラスの機能を学ぼうとしています(https://learn.microsoft.com/en-us/windows/win32/secprov/win32-encryptablevolume)。この目的のために VM を作成し、単純な Bitlocker パスワード (TPM なし) を使用して保護しました。
次の PowerShell スクリプトを作成しました。キー プロテクター ID が正しいことはわかっています (GetKeyProtectors を使用して検証され、そのファイルから Bitlocker が作成した回復キー ファイルが Bitlocker によって印刷されます)。
# 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 は、エラー 2147746291 に対して次の出力を生成します。
# for decimal -2147221005 / hex 0x800401f3
CO_E_CLASSSTRING winerror.h
# Invalid class string
# 1 matches found for "2147746291"
クラス文字列がどのように間違っているのかわかりません。