首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Foms身份验证和Windows身份验证IIS之间切换的PowerShell脚本

问在Foms身份验证和Windows身份验证IIS之间切换的PowerShell脚本
EN

Stack Overflow用户
提问于 2016-05-12 20:05:57
回答 1查看 646关注 0票数 0

我得到了创建IIS /池的power shell脚本。默认情况下,网站是表单身份验证,我想将它从ps script.Found切换到windows身份验证如何做,但表单身份验证不禁用,并且我的表单和win身份验证都已启用,这是一个禁用表单身份验证的problem.How,因此我只能拥有windows身份验证?

EN

回答 1

Stack Overflow用户

发布于 2016-05-16 19:59:42

要启用windows并禁用窗体身份验证,请执行以下操作:

代码语言:javascript
复制
$config = (Get-WebConfiguration system.web/authentication "IIS:\sites\$iisAppName")
$config.mode = "Windows"
$config | Set-WebConfiguration system.web/authentication
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/windowsAuthentication -name enabled -value true -PSPath IIS:\ -location $iisAppName/$iisAppPoolName

要禁用windows并启用窗体,请执行以下操作:

代码语言:javascript
复制
$config = (Get-WebConfiguration system.web/authentication "IIS:\sites\$iisAppName")
$config.mode = "Forms"
$config | Set-WebConfiguration system.web/authentication

$winAuth = Get-WebConfiguration -filter /system.webServer/security/authentication/windowsAuthentication
$winAuth.enabled = $false
$winAuth | set-Webconfiguration -filter /system.webServer/security/authentication/windowsAuthentication -PSPath IIS:\ -location "$iisAppName"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37186386

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档