Enables or disables basic authentication for all or part of a website.
Set-IisBasicAuthentication [-SiteName] <String> [[-Path] <String>] [-Disabled] [-WhatIf] [-Confirm] [<CommonParameters>]
By default, enables basic authentication on a website. You can enable basic authentication at a specific path under a website by passing the virtual path (not the physical path) to that directory.
To disable basic authentication, set the Disabled
flag.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SiteName | String | The site where basic authentication should be set. | true | false | |
Path | String | The optional virtual path (not a physical path) where basic authentication should be set. | false | false | |
Disabled | SwitchParameter | Disable basic authentication. Otherwise, it is enabled. | false | false | |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Set-IisBasicAuthentication -SiteName Peanuts
Turns on basic authentication for the Peanuts
website.
Set-IisBasicAuthentication -SiteName Peanuts Snoopy/DogHouse
Turns on basic authentication for the Snoopy/DogHouse
directory under the Peanuts
website.
Set-IisBasicAuthentication -SiteName Peanuts -Disabled
Turns off basic authentication for the Peanuts
website.