Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$query=New-XPathQuery -AttributeName DisplayName -Operator StartsWith "__MPR:"
$Expression=New-XPathExpression -ObjectType "ManagementPolicyRule" -QueryObject $query
$AllMPRs=Search-Resources $Expression
ForEach ($MPR in $AllMPRs)
$Resource=Get-Resource -ObjectType ManagementPolicyRule -AttributeName ObjectID -AttributeValue $MPR.ObjectID
$Resource.Disabled = "True"
#$Resource.Disabled = "False"
Save-Resource $Resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.