Skip to content

Instantly share code, notes, and snippets.

@theangryangel
Created June 20, 2016 08:00
Show Gist options
  • Save theangryangel/28776419988720ed3534b92db0ec12cf to your computer and use it in GitHub Desktop.
Save theangryangel/28776419988720ed3534b92db0ec12cf to your computer and use it in GitHub Desktop.
Add authenticated users with read permissions to address kb3159398/MS16-072
Get-GPO -All | ForEach-Object {
if ('S-1-5-11' -notin ($_ | Get-GPPermission -All).Trustee.Sid.Value) {
$_ | Set-GPPermission -PermissionLevel GpoRead -TargetName 'Authenticated Users' -TargetType Group -Verbose
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment