Created
November 2, 2019 19:51
-
-
Save CodyMathis123/57adf90c916b3f24e385624787efe934 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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