10 lines
506 B
PowerShell
10 lines
506 B
PowerShell
$policyRuleName = "Alert" # The type of policy that should be removed.
|
|
$remoteAccessPolicyRuleRef = $wsmanConnectionObject.NewReference("AMT_RemoteAccessPolicyRule")
|
|
foreach($remoteAccessPolicyRuleItem in $remoteAccessPolicyRuleRef.Enumerate())
|
|
{
|
|
if($remoteAccessPolicyRuleItem.Object.GetProperty("PolicyRuleName") -like $policyRuleName)
|
|
{
|
|
$remoteAccessPolicyRuleRef = $remoteAccessPolicyRuleItem.Object.ToReference("PolicyRuleName", "CreationClassName")
|
|
$remoteAccessPolicyRuleRef.Delete()
|
|
}
|
|
} |