如何通过PowerShell在IIS服务器级设置Forms Authentication功能委派为只读?
在IIS服务器级别通过PowerShell设置Forms Authentication为只读(功能委派)
要实现服务器级别将Forms Authentication的功能委派设为“只读”,只需将对应配置节点的overrideMode值设为Deny(拒绝站点级覆盖)——你之前的命令错误地设置成了Allow(允许覆盖),正确命令如下:
Set-WebConfiguration -Filter "/system.webServer/security/authentication/formsAuthentication" -Metadata overrideMode -Value Deny -PSPath "IIS:\"
验证设置是否生效
执行以下命令查看当前的overrideMode值,确认是否已设为Deny:
Get-WebConfiguration -Filter "/system.webServer/security/authentication/formsAuthentication" -Metadata overrideMode -PSPath "IIS:\"
注意:执行上述PowerShell命令需要以管理员权限运行,否则会因权限不足操作失败。
内容的提问来源于stack exchange,提问作者Vivek Pandey
相关产品推荐
相关产品推荐

