首页 文章

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

提问于
浏览
1

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

C:\Windows\system32>%systemroot%\system32\inetsrv\appcmd.exe set config "Reviewer" /section:anonymousAuthentication /enabled:false

我收到此错误:

错误(消息:无法将属性“启用”设置为值“false” . 原因:此配置部分不能在此路径中使用 . 当部分锁定在父级别时会发生这种情况 . 默认情况下锁定(overrideModeDefault = “拒绝”),或由locationMode =“Deny”或遗留allowOverride =“false”的位置标记显式设置 .

你能帮我么?

2 回答

  • 0

    我设法通过在最后添加 /commit:apphost 来解决锁定问题 .

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

    好了,再挖一点这个了 . 我有一个环境120服务器启用了默认ftp匿名:

    有两种方式:

    • 默认主机

    • 默认FTP站点

    以下是自动执行此操作的方法:

    注意:此行将从主机中删除匿名:

    appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.anonymousAuthentication.enabled:"False" /commit:apphost
    

    此行将从Ftp站点中删除Anonymous

    appcmd.exe set config -section:system.applicationHost/sites /[name='default'].ftpServer.security.authentication.anonymousAuthentication.enabled:"False" /commit:apphost
    

    路径: C:\Windows\System32\inetsrv>

相关问题