Tests if IIS authentication types are enabled or disabled on a site and/or virtual directory under that site.
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>]
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.
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 |
Test-IisSecurityAuthentication -SiteName Peanuts -Anonymous
Returns true
if anonymous authentication is enabled for the Peanuts
site. False
if it isn't.
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.