authentication - 使用 AppCmd 设置特定的 IIS 7 站点?

标签 authentication iis-7 batch-file scripting

我有一台带有多个应用程序/虚拟目录的 IIS 7 机器,默认情况下
网站。我想使用此身份验证设置其中两个:
匿名 - 关闭
冒充 - 开
表单认证关闭
Windows 身份验证 - 打开

我想使用 appcmd.exe 执行此操作,但似乎无法获得
语法正确。有没有人有这方面的运气?

谢谢。

最佳答案

您应该尝试使用配置编辑器(包含在 IIS 7.5 中,可在 http://www.iis.net/download/AdministrationPack 处为 IIS 7.0 下载),它可以自动生成 AppCmd.exe 命令以及 javascript 和托管代码。使用它我生成了以下内容(对于默认网站):

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False"  

appcmd.exe set config "Default Web Site" -section:system.web/identity /impersonate:"True"  

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True"  /commit:apphost

请注意,带有 commit:apphost 的是因为默认情况下这些部分是锁定的,这意味着它们需要使用位置路径在 ApplicationHost.config 中设置。

关于authentication - 使用 AppCmd 设置特定的 IIS 7 站点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3295578/

相关文章:

iis - Windows 身份验证通过反向代理问题

java - LDAP 身份验证 NULL

iis-7 - 在 IIS7 上托管 Mercurial

windows - 检查所有驱动器(字母和自由大小)并比较高数字自由大小

windows - 重命名文件时出现错误 "The syntax of the command is incorrect"

authentication - 在 nginx 上使用一次性 cookie 进行非常简单的身份验证

wordpress - React native 重定向身份验证 api

asp.net-mvc-2 - 用于分析 ASP.NET MVC Web 服务器性能的免费工具和方法?

python - Windows Server 2008/IIS 7 上 Mercurial 1.9.2 的 HTTPS 给我 Errno 10054

php - Windows Bat 检查 php 脚本是否运行