Set-IisBasicAuthentication

Enables or disables basic authentication for all or part of a website.

Syntax

Set-IisBasicAuthentication [-SiteName] <String> [[-Path] <String>] [-Disabled] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

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.

Parameters

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.

EXAMPLE 1

Set-IisBasicAuthentication -SiteName Peanuts

Turns on basic authentication for the Peanuts website.

EXAMPLE 2

Set-IisBasicAuthentication -SiteName Peanuts Snoopy/DogHouse

Turns on basic authentication for the Snoopy/DogHouse directory under the Peanuts website.

EXAMPLE 3

Set-IisBasicAuthentication -SiteName Peanuts -Disabled

Turns off basic authentication for the Peanuts website.