我得到了创建IIS /池的power shell脚本。默认情况下,网站是表单身份验证,我想将它从ps script.Found切换到windows身份验证如何做,但表单身份验证不禁用,并且我的表单和win身份验证都已启用,这是一个禁用表单身份验证的problem.How,因此我只能拥有windows身份验证?
发布于 2016-05-16 19:59:42
要启用windows并禁用窗体身份验证,请执行以下操作:
$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并启用窗体,请执行以下操作:
$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"https://stackoverflow.com/questions/37186386
复制相似问题