I have many group policies. I want to find a setting in all my gpos and then edit the same setting in all the gpo’s using powershell.
Specifically, I have Restricted Group settings defined in multiple GPO’s.I want to find all the policies with restricted group settings defined which have the group “Account Operators” added as MemberOf and remove this group from MemberOf. If there are other groups added to the MemberOf apart from “Account Operators”, I want to leave them as it is and only remove the “Account Operators” group. So far I have something like this:
Get-GPO -All |
[xml]$xml = $_ | Get-GPOReport -ReportType Xml
if($xml.GPO.Computer.ExtensionData.Extension.RestrictedGroups.MemberOf.Name.’#text’ -like “Account”)