Test-IisSecurityAuthentication

Tests if IIS authentication types are enabled or disabled on a site and/or virtual directory under that site.

Syntax

Test-IisSecurityAuthentication -SiteName <String> [-VirtualPath <String>] -Anonymous [<CommonParameters>]
Test-IisSecurityAuthentication -SiteName <String> [-VirtualPath <String>] -Basic [<CommonParameters>]
Test-IisSecurityAuthentication -SiteName <String> [-VirtualPath <String>] -Digest [<CommonParameters>]
Test-IisSecurityAuthentication -SiteName <String> [-VirtualPath <String>] -Windows [<CommonParameters>]

Description

You can check if anonymous, basic, or Windows authentication are enabled. There are switches for each authentication type.

Beginning with Carbon 2.0.1, this function is available only if IIS is installed.

Parameters

Name Type Description Required? Pipeline Input Default Value
SiteName String

The site where anonymous authentication should be set.

true false
VirtualPath String

The optional path where anonymous authentication should be set.

false false
Anonymous SwitchParameter

Tests if anonymous authentication is enabled.

true false False
Basic SwitchParameter

Tests if basic authentication is enabled.

true false False
Digest SwitchParameter

Tests if digest authentication is enabled.

true false False
Windows SwitchParameter

Tests if Windows authentication is enabled.

true false False

Return Values

System.Boolean.

EXAMPLE 1

Test-IisSecurityAuthentication -SiteName Peanuts -Anonymous

Returns true if anonymous authentication is enabled for the Peanuts site. False if it isn't.

EXAMPLE 2

Test-IisSecurityAuthentication -SiteName Peanuts -VirtualPath Doghouse -Basic

Returns true if basic authentication is enabled forDoghouse directory under the Peanuts site. False if it isn't.