serverRoom/amt-sdk-20-0-0-1/IntelvProModule/PS_Snippets/Remote Access/Remove a Management Presence Server5.ps1

9 lines
724 B
PowerShell

$remoteAccessPolicyAppliesToMPSRef = $wsmanConnectionObject.NewReference("AMT_RemoteAccessPolicyAppliesToMPS")
# $mpServer is an EPR to the AMT_ManagementPresenceRemoteSAP object created by the 'Add a Management Presence Server' use case.
$remoteAccessPolicyAppliesToMPSRef.AddSelector("ManagedElement",$mpServerRef)
# Traverse to the AMT_RemoteAccessPolicyAppliesToMPS instances that are connected to the $mpServer.
foreach($remoteAccessPolicyAppliesToMPSItem in $remoteAccessPolicyAppliesToMPSRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter", $null))
{
$remoteAccessPolicyRuleRef = $remoteAccessPolicyAppliesToMPSItem.Object.GetProperty("PolicySet").Ref
$remoteAccessPolicyRuleRef.Delete()
}