Skip to content

Instantly share code, notes, and snippets.

@jacksoneyton
Created August 8, 2016 18:32
Show Gist options
  • Save jacksoneyton/cf42402e5bbe4e122e48fb68eada64bb to your computer and use it in GitHub Desktop.
Save jacksoneyton/cf42402e5bbe4e122e48fb68eada64bb to your computer and use it in GitHub Desktop.
Gets windows update settings as listed in GPO policies.
#reqiures -Modules GroupPolicy
foreach ($gpo in (Get-GPO -All)) {
$xml = [Xml](Get-GPOReport -Guid $gpo.Id -ReportType Xml)
if (($xml.GPO.SelectNodes("//*[local-name() = 'Name']")."#text" | Where-Object { $_ -eq "Configure Automatic Updates" }).Count -gt 0) {
Write-Output -InputObject "The following GPO is configuring Windows Update Settings: '$($xml.GPO.Name)'."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment