20 lines
1.1 KiB
PowerShell

# Create a reference to the CIM_ComputerSystem instance.
$computerSystemRef = $wsmanConnectionObject.NewReference("SELECT * FROM CIM_ComputerSystem WHERE Name='Intel(r) AMT'")
$elementSettingDataRef = $wsmanConnectionObject.NewReference("CIM_ElementSettingData")
$elementSettingDataRef.AddSelector("ManagedElement", $computerSystemRef)
# Traverse to the CIM_ElementSettingData instances that are connected to CIM_ComputerSystem.
foreach($elementSettingDataItem in $elementSettingDataRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter", $null))
{
$isCurrent = $elementSettingDataItem.Object.GetProperty("IsCurrent")
if($isCurrent -like "1")
{
# For each instance, check if it is associated to the AMT_SystemPowerScheme instance.
if($elementSettingDataItem.Object.GetProperty("SettingData").IsA("AMT_SystemPowerScheme"))
{
# Get the AMT_systemPowerScheme object using its EPR.
$systemPowerSchemeInstance = $elementSettingDataItem.Object.GetProperty("SettingData").Ref.Get()
$schemeGUID = $systemPowerSchemeInstance.GetProperty("SchemeGUID")
break
}
}
}