
我正在嘗試學習 Win32_EncryptableVolume 類別功能(https://learn.microsoft.com/en-us/windows/win32/secprov/win32-encryptablevolume)。我為此創建了一個虛擬機,並使用簡單的 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"
我不確定類別字串是如何不正確的?