設定匿名驗證。
Syntax
class AnonymousAuthenticationSection : ConfigurationSection
方法
下表列出 類別所 AnonymousAuthenticationSection 公開的方法。
| 名稱 | 描述 |
|---|---|
| GetAllowDefinition | (繼承自 ConfigurationSection.) |
| GetAllowLocation | (繼承自 ConfigurationSection。) |
| RevertToParent | (繼承自 ConfigurationSection。) |
| SetAllowDefinition | (繼承自 ConfigurationSection。) |
| SetAllowLocation | (繼承自 ConfigurationSection。) |
屬性
下表列出 類別所 AnonymousAuthenticationSection 公開的屬性。
| 名稱 | 描述 |
|---|---|
Enabled |
讀取/寫入 boolean 值。 true 如果已啟用匿名驗證,則為 ;否則為 false 。 預設值為 true。 |
Location |
(繼承自 ConfigurationSection .) 索引鍵屬性。 |
LogonMethod |
讀取/寫入 sint32 列舉,指定登入的方法。 可能的值稍後會列在一節中。 |
Password |
包含密碼的讀取/寫入加密 string 值。 |
Path |
(繼承自 ConfigurationSection .) 索引鍵屬性。 |
UserName |
包含使用者名稱的讀取/寫入 string 值。 預設值為 「IUSR」。 |
SectionInformation |
(繼承自 ConfigurationSection。) |
子類別
這個類別不包含子類別。
備註
下表列出 屬性的可能值 LogonMethod 。 預設值為 3 (ClearText) 。
| 值 | 關鍵字 | 描述 |
|---|---|---|
| 0 | Interactive |
此登入類型適用于以互動方式使用電腦的使用者。 |
| 1 | Batch |
此登入類型適用于批次伺服器,其中進程可能會代表使用者執行,而不需直接介入。 此登入類型不會快取認證。 |
| 2 | Network |
此登入類型適用于高效能伺服器來驗證純文字密碼。 此登入類型不會快取認證。 |
| 3 | ClearText |
此登入類型會保留驗證套件中的名稱和密碼,這可讓伺服器在模擬用戶端時連線到其他網路伺服器。 |
範例
下列範例會顯示 AnonymousAuthenticationSection 預設網站的值。
' 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
繼承階層架構
AnonymousAuthenticationSection
規格需求
| 類型 | 描述 |
|---|---|
| Client | - Windows Vista 上的 IIS 7.0 - Windows 7 上的 IIS 7.5 - Windows 8 上的 IIS 8.0 - Windows 10上的 IIS 10.0 |
| 伺服器 | - Windows Server 2008 上的 IIS 7.0 - Windows Server 2008 R2 上的 IIS 7.5 - Windows Server 2012 上的 IIS 8.0 - Windows Server 2012 R2 上的 IIS 8.5 - Windows Server 2016上的 IIS 10.0 |
| 產品 | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 |
| MOF 檔案 | WebAdministration.mof |
另請參閱
AuthenticationSection 類別
BasicAuthenticationSection 類別
ClientCertificateMappingAuthenticationSection 類別
ConfigurationSection 類別
DigestAuthenticationSection 類別
FormsAuthenticationConfiguration 類別
FormsAuthenticationCredentials 類別
FormsAuthenticationUser 類別
IisClientCertificateMappingAuthenticationSection 類別
PassportAuthentication 類別
WindowsAuthenticationSection 類別