Home > front end >  IIS Command To Get Status Of Anonymous Access and Authentication Control
IIS Command To Get Status Of Anonymous Access and Authentication Control

Time:04-25

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

Stolen from enter image description here

enter image description here

  • Related