Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Created November 2, 2019 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyMathis123/57adf90c916b3f24e385624787efe934 to your computer and use it in GitHub Desktop.
Save CodyMathis123/57adf90c916b3f24e385624787efe934 to your computer and use it in GitHub Desktop.
$Remediate = $false
Import-Module WebAdministration
$UseAppPoolIdentity = (Get-WebConfigurationProperty -Filter 'system.WebServer/security/authentication/AnonymousAuthentication' -Name username -Location 'WSUS Administration/Content') -eq ''
switch ($UseAppPoolIdentity) {
$true {
$true
}
$false {
switch ($Remediate) {
$true {
Set-WebConfigurationProperty -Filter 'system.WebServer/security/authentication/AnonymousAuthentication' -name username -value '' -location 'WSUS Administration/Content'
$true
}
$false {
$false
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment