IT:AD:Infrastructure:IIS:Issues:500.19:Section is Locked at a Parent Level
Summary
Installed a new site.
Getting an error message about:
This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
And below that:
<windowsAuthentication enabled="true" useKernelMode="true" useAppPoolCredentials="true">
Cause
The parent applicationHost.config
element is locking it down.
Solution
Need to use one or both of the following commands to edit the applicationHost.config
file located within C:\Windows\System32\inetsrv\config
(changing the name of the website of course):
C:\Windows\System32\inetsrv\appcmd.exe unlock config "Default Web Site" /section:anonymousAuthentication -commit:apphost C:\Windows\System32\inetsrv\appcmd.exe unlock config "Default Web Site" /section:windowsAuthentication -commit:apphost
this generates something like below in Windows 7:
<location path="Default Web Site" overrideMode="Allow"> <system.webServer> <security> <authentication> <anonymousAuthentication /> <windowsAuthentication> <providers /> <extendedProtection /> </windowsAuthentication> </authentication> </security> </system.webServer> </location>