Under the authentication section of IIS, I am trying to check if anonymous access is enabled or disabled via command line, I have crafted the following command, but it seems to not be grabbing the setting correctly:
Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "system.webServer/asp" -name "anonymousAuthentication" | select enabled
Is anyone able to help me, please?
CodePudding user response:
Try this:
$anonAuthFilter = '/system.WebServer/security/authentication/anonymousAuthentication'
Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter $anonAuthFilter -name Enabled