Authentication 使用appcmd在IIS中禁用匿名身份验证时出错

Authentication 使用appcmd在IIS中禁用匿名身份验证时出错,authentication,iis,appcmd,Authentication,Iis,Appcmd,我正试图通过运行以下命令禁用匿名身份验证: C:\Windows\system32>%systemroot%\system32\inetsrv\appcmd.exe set config "Reviewer" /section:anonymousAuthentication /enabled:false 我得到这个错误: 错误(消息:无法将属性“enabled”设置为值“false”。。原因:此配置节不能在此路径上使用。当节在父级锁定时会发生这种情况。锁定默认情况下(overrideMo

我正试图通过运行以下命令禁用匿名身份验证:

C:\Windows\system32>%systemroot%\system32\inetsrv\appcmd.exe set config "Reviewer" /section:anonymousAuthentication /enabled:false
我得到这个错误:

错误(消息:无法将属性“enabled”设置为值“false”。。原因:此配置节不能在此路径上使用。当节在父级锁定时会发生这种情况。锁定默认情况下(overrideModeDefault=“Deny”),或由带有overrideMode=“Deny”或旧版allowOverride=“false”的位置标记显式设置。 )


您能帮助我吗?

我通过在末尾添加
/commit:apphost
解决了锁定问题

%systemroot%\system32\inetsrv\appcmd.exe set config "Reviewer" /section:system.webServer/security/authentication/anonymousAuthentication /enabled:false /commit:apphost

好吧,在这上面再挖一点。 我的环境中有120多台服务器启用了默认的ftp匿名:

有两种方式:

  • 默认主机
  • 默认FTP站点
以下是实现自动化的方法:

注: 此行将从主机中删除匿名服务器:

appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.anonymousAuthentication.enabled:"False" /commit:apphost
此行将从Ftp站点中删除匿名文件

appcmd.exe set config -section:system.applicationHost/sites /[name='default'].ftpServer.security.authentication.anonymousAuthentication.enabled:"False" /commit:apphost
路径:
C:\Windows\System32\inetsrv>