Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Created November 2, 2019 19:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
$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