【问题标题】:Using appcmd to set the anonymous authentication user for a specific Site使用 appcmd 为特定站点设置匿名身份验证用户
【发布时间】:2014-11-17 21:14:22
【问题描述】:

如果我通过 IIS UI,我可以选择一个站点,在 IIS 下打开身份验证,然后编辑匿名身份验证以使用应用程序池标识。但是,当我尝试使用 appcmd 做同样的事情时遇到了一个问题:

appcmd set config "SiteName" /section:anonymousAuthentication /userName:

当我运行它时,我得到以下信息:

ERROR ( message:Can not set attribute "userName" to value "".. Reason: 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".
. )

现在,我显然可以通过 UI 执行此操作,因此我的 appcmd 命令必须尝试执行与通过 UI 完成的操作不同的操作。问题是,如何使用 appcmd 复制我的 UI 操作?

【问题讨论】:

    标签: iis-7.5 appcmd


    【解决方案1】:

    我刚刚遇到了同样的问题。如其所述,您尝试更新的部分已锁定,因此只需在您之前运行此命令即可解锁匿名身份验证配置部分:

    appcmd unlock config -section:system.webServer/security/authentication/anonymousAuthentication -commitpath:apphost
    

    您的配置更改现在应该会成功处理!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-18
      • 1970-01-01
      • 2016-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多