且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Powershell配置IIS - 启用表单身份验证

更新时间:2023-11-02 23:40:16

您将身份验证配置设置传输到Set-Webconfiguration,在您修改后提供适当的过滤器你的属性:

You pipe the authentication configuration settings to Set-Webconfiguration giving the appropriate filter after you modify your properties:

$config = (Get-WebConfiguration system.web/authentication 'IIS:\sites\Default Web Site')
$config.mode = "Forms"
$config | Set-WebConfiguration system.web/authentication

注意:在尝试之前备份您的配置。