How do you change the allowDefinition section attribute using appcmd in IIS 7?

风格不统一 提交于 2019-12-01 03:08:48

My problem was, I had to change anonymousAuthentication from False to True. When I did: appcmd set config websitename /section:anonymousAuthentication /enabled:True

Error I got: Config Error This configuration cannot be used at this path. This happens when the section is locked at the parent level. Locking is either by default(overrideModeDefault="Deny")...

To unlock, do the following: appcmd unlock config /section:? This will list the section you want. Then type:

appcmd unlock config /section:system.webserver/security/authentication/anonymousauthentication

Thats it... :)

tb.

Try using %windir%\system32\inetsrv\appcmd unlock config -section:*sectionName*. See http://blog.donnfelker.com/2007/03/26/iis-7-this-configuration-section-cannot-be-used-at-this-path/

I actually came across a need to do just that after posting this answer.

%systemroot%\System32\inetsrv\appcmd.exe unlock config /section:system.WebServer/[rest of the path to config section you need to edit]

One big warning, you should NEVER change the allowDefinition, that is an important setting that is usually there for a reason, for example it might be that even if you set it in a specific directory or app it will not work, so the developers have specified that.

So please, never modify the allowDefinition attribute in the section definitions. On the other hand you can modify the overrideModeDefault which will allow users to define it in a different place if allowed by definition.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!