serverRoom/amt-sdk-20-0-0-1/IntelvProModule/PS_Snippets/RemoteControl/Get Boot Details for a Boot Configuration Setting Instance.ps1

20 lines
1.1 KiB
PowerShell

# Create a reference to the CIM_BootConfigSetting instance.
$bootConfigSettingRef = $wsmanConnectionObject.NewReference("SELECT * FROM CIM_BootConfigSetting WHERE InstanceID='Intel(r) AMT: Boot Configuration 0'")
$orderedComponentRef = $wsmanConnectionObject.NewReference("CIM_OrderedComponent")
$orderedComponentRef.AddSelector("GroupComponent", $bootConfigSettingRef)
# Traverse to the CIM_OrderedComponent instances that are connected to the CIM_BootConfigSetting.
foreach($orderedComponentItem in $orderedComponentRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter", $null))
{
# For each instance, check if it is associated to the CIM_BootSourceSetting instance.
if($orderedComponentItem.Object.GetProperty("PartComponent").IsA("CIM_BootSourceSetting"))
{
$assignedSequence = $orderedComponentItem.Object.GetProperty("AssignedSequence")
if ($assignedSequence -like "1")
{
# Get the CIM_BootSourceSetting object using its EPR.
$bootSourceSettingInstance = $orderedComponentItem.Object.GetProperty("PartComponent").Ref.Get()
$instanceID = $bootSourceSettingInstance.GetProperty("InstanceID")
break
}
}
}