18 lines
1.3 KiB
PowerShell
18 lines
1.3 KiB
PowerShell
# Create a reference to the CIM_EthernetPort instance, select the wired interface.
|
|
$ethernetPortRef = $wsmanConnectionObject.NewReference("SELECT * FROM CIM_EthernetPort WHERE DeviceID='Intel(r) AMT Ethernet Port 0'")
|
|
$environmentDetectionInterfacePolicyRef = $wsmanConnectionObject.NewReference("AMT_EnvironmentDetectionInterfacePolicy")
|
|
$environmentDetectionInterfacePolicyRef.AddSelector("Antecedent", $ethernetPortRef)
|
|
# Traverse to the AMT_EnvironmentDetectionInterfacePolicy instances that are connected to the CIM_EthernetPort instance.
|
|
foreach($environmentDetectionInterfacePolicyItem in $environmentDetectionInterfacePolicyRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter", $null))
|
|
{
|
|
# For each instance, check if it is associated to the AMT_SystemDefensePolicy instance.
|
|
if($environmentDetectionInterfacePolicyItem.Object.GetProperty("Dependent").IsA("AMT_SystemDefensePolicy"))
|
|
{
|
|
if(($environmentDetectionInterfacePolicyItem.Object.GetProperty("Enabled") -like $true) -or ($environmentDetectionInterfacePolicyItem.Object.GetProperty("Active") -like $true))
|
|
{
|
|
# Get the AMT_SystemDefensePolicy object using its EPR.
|
|
$systemDefensePolicyInstance = $environmentDetectionInterfacePolicyItem.Object.GetProperty("Dependent").Ref.Get()
|
|
break
|
|
}
|
|
}
|
|
} |