Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

AnonymousAuthenticationSection Class [IIS 7 and higher]

IIS 7.0

Configures Anonymous authentication.

class AnonymousAuthenticationSection : ConfigurationSection

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

Name

Description

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

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

Name

Description

Enabled

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

Location

(Inherited from ConfigurationSection.) A key property.

LogonMethod

A read/write sint32 enumeration that specifies the method for logons. The possible values are listed later in the Remarks section.

Password

A read/write encrypted string value that contains a password.

Path

(Inherited from ConfigurationSection.) A key property.

UserName

A read/write string value that contains a user name. The default is "IUSR".

SectionInformation

(Inherited from ConfigurationSection.)

This class contains no subclasses.

The following table lists the possible values for the LogonMethod property. The default is 3 (ClearText).

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.

The following example displays the AnonymousAuthenticationSection values for the default Web site.

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

' Get the Anonymous authentication section for the default
' Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "AnonymousAuthenticationSection", oAnonAuth

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

' Display the Enabled, LogonMethod, UserName, and Password
' properties.
WScript.Echo "Enabled: " & _
    "[" & oAnonAuth.Enabled & "]"
WScript.Echo "LogonMethod: " &  _
    "[" & GetLogonMethodText(oAnonAuth.LogonMethod) & "]"
WScript.Echo "UserName: " & "[" & oAnonAuth.UserName & "]"
WScript.Echo "Password: " & "[" & oAnonAuth.Password & "]"

' 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 value."
    End Select
End Function

ConfigurationSection

   AnonymousAuthenticationSection

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.