
저는 Win32_EncryptableVolume 클래스 기능을 배우려고 놀고 있습니다(https://learn.microsoft.com/en-us/windows/win32/secprov/win32-encryptablevolume). 저는 해당 목적에 맞게 VM을 생성하고 간단한 Bitlocker 비밀번호(TPM 없음)를 사용하여 이를 보호했습니다.
다음 PowerShell 스크립트를 만들었습니다. Key Protector 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"
클래스 문자열이 어떻게 잘못되었는지 잘 모르겠습니다.