BasicAuthenticationSection Class [IIS 7 and higher]

Configures Basic authentication.

Syntax

class BasicAuthenticationSection : ConfigurationSection

Methods

The following table lists the methods exposed by the BasicAuthenticationSection class.

Name

Description

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

Properties

The following table lists the properties exposed by the BasicAuthenticationSection class.

Name

Description

DefaultLogonDomain

A read/write string value that specifies the default domain that the server uses to authenticate users when the client does not specify a domain in the logon dialog box.

Enabled

A read/write boolean value. true if Basic authentication is enabled; otherwise, false. The default is false.

Location

(Inherited from ConfigurationSection.) A key property.

LogonMethod

A read/write sint32 enumeration that specifies the default logon method for a local user. The type of logon will determine whether the resulting token can also be used remotely. The possible values are listed later in the Remarks section.

Path

(Inherited from ConfigurationSection.) A key property.

Realm

A read/write string value that contains the name of the realm that is used by the client for credential caching.

SectionInformation

(Inherited from ConfigurationSection.)

Subclasses

This class contains no subclasses.

Remarks

The following table contains the possible values for the LogonMethod property. The default is 3 (ClearText). For more information, see the LogonUserEx function.

Value

Keyword

Description

0

Interactive

This logon type is intended for users who will be interactively using the computer.

1

Batch

This logon type is intended for batch servers, where processes may be executing on behalf of a user without their direct intervention. Credentials are not cached for this logon type.

2

Network

This logon type is intended for high performance servers to authenticate plaintext passwords. Credentials are not cached for this logon type.

3

ClearText

This logon type preserves the name and password in the authentication package, which allows the server to make connections to other network servers while impersonating the client.

Example

The following example displays the BasicAuthenticationSection configuration for the default Web site.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
    GetObject("winmgmts:root\WebAdministration")

' Get the Basic authentication section for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "BasicAuthenticationSection", oBasicAuth

' Display the path and location.
WScript.Echo "Basic Authentication Settings"
WScript.Echo "-----------------------------"
WScript.Echo "Path: " & oBasicAuth.Path
WScript.Echo "Location: " & oBasicAuth.Location
WScript.Echo 

' Display the Enabled, DefaultLogonDomain, Realm, and 
' LogonMethod properties.
WScript.Echo "Enabled: " & _
    "[" & oBasicAuth.Enabled & "]"

WScript.Echo "DefaultLogonDomain: " & _
    "[" & oBasicAuth.DefaultLogonDomain & "]"

WScript.Echo "Realm: " & "[" & oBasicAuth.Realm & "]"

WScript.Echo "LogonMethod: " &  _
    "[" & GetLogonMethodText(oBasicAuth.LogonMethod) & "]"

' Translate the LogonMethod enumeration values to text.
Function GetLogonMethodText(LogonMethodValue)
    Select Case LogonMethodValue
        Case 0
            GetLogonMethodText = "Interactive"
        Case 1
            GetLogonMethodText = "Batch"
        Case 2
            GetLogonMethodText = "Network"
        Case 3
            GetLogonMethodText = "ClearText"
        Case Else
            GetLogonMethodText = "Undefined enumeration."
    End Select
End Function

Inheritance Hierarchy

ConfigurationSection

   BasicAuthenticationSection

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

AnonymousAuthenticationSection Class [IIS 7 and higher]

AuthenticationSection Class [IIS 7 and higher]

ClientCertificateMappingAuthenticationSection Class [IIS 7 and higher]

DigestAuthenticationSection Class [IIS 7 and higher]

FormsAuthenticationConfiguration Class [IIS 7 and higher]

FormsAuthenticationCredentials Class [IIS 7 and higher]

FormsAuthenticationUser Class [IIS 7 and higher]

IisClientCertificateMappingAuthenticationSection Class [IIS 7 and higher]

PassportAuthentication Class [IIS 7 and higher]

WindowsAuthenticationSection Class [IIS 7 and higher]

Other Resources

LogonUserEx