AnonymousAuthenticationSection Class1

Configures Anonymous authentication.

Syntax

class AnonymousAuthenticationSection : ConfigurationSection  

Methods

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.)

Properties

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.)

Subclasses

This class contains no subclasses.

Remarks

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.

Example

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  
  

Inheritance Hierarchy

ConfigurationSection

AnonymousAuthenticationSection

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF file WebAdministration.mof

See Also

AuthenticationSection Class
BasicAuthenticationSection Class
ClientCertificateMappingAuthenticationSection Class
ConfigurationSection Class
DigestAuthenticationSection Class
FormsAuthenticationConfiguration Class
FormsAuthenticationCredentials Class
FormsAuthenticationUser Class
IisClientCertificateMappingAuthenticationSection Class
PassportAuthentication Class
WindowsAuthenticationSection Class