Partager via


Classe BasicAuthenticationSection

Configure l’authentification de base.

Syntaxe

class BasicAuthenticationSection : ConfigurationSection  

Méthodes

Le tableau suivant répertorie les méthodes exposées par la classe BasicAuthenticationSection.

Nom Description
GetAllowDefinition (Hérité de ConfigurationSection.)
GetAllowLocation (Hérité de ConfigurationSection.)
RevertToParent (Hérité de ConfigurationSection.)
SetAllowDefinition (Hérité de ConfigurationSection.)
SetAllowLocation (Hérité de ConfigurationSection.)

Propriétés

Le tableau suivant répertorie les propriétés exposées par la classe BasicAuthenticationSection.

Nom Description
DefaultLogonDomain Valeur de string en lecture/écriture qui spécifie le domaine par défaut que le serveur utilise pour authentifier les utilisateurs lorsque le client ne spécifie pas de domaine dans la boîte de dialogue d’ouverture de session.
Enabled Valeur de boolean en lecture/écriture. true si l’authentification de base est activée ; sinon, false. Par défaut, il s’agit de false.
Location (Hérité de ConfigurationSection.) Propriété de clé.
LogonMethod Énumération sint32 en lecture/écriture qui spécifie la méthode d’ouverture de session par défaut pour un utilisateur local. Le type d’ouverture de session détermine si le jeton résultant peut également être utilisé à distance. Les valeurs possibles sont répertoriées plus loin dans la section Remarques.
Path (Hérité de ConfigurationSection.) Propriété de clé.
Realm Valeur de string en lecture/écriture qui contient le nom du domaine utilisé par le client pour la mise en cache des informations d’identification.
SectionInformation (Hérité de ConfigurationSection.)

Sous-classes

Cette classe ne contient aucune sous-classe.

Notes

Le tableau suivant contient les valeurs possibles pour la propriété LogonMethod. La valeur par défaut est 3 (ClearText). Pour plus d’informations, consultez la fonction LogonUserEx.

Valeur Mot clé Description
0 Interactive Ce type d’ouverture de session est destiné aux utilisateurs qui utiliseront l’ordinateur de manière interactive.
1 Batch Ce type d’ouverture de session est destiné aux serveurs batch, où les processus peuvent s’exécuter pour le compte d’un utilisateur sans leur intervention directe. Les informations d’identification ne sont pas mises en cache pour ce type d’ouverture de session.
2 Network Ce type de connexion est destiné aux serveurs hautes performances pour authentifier les mots de passe en texte clair. Les informations d’identification ne sont pas mises en cache pour ce type d’ouverture de session.
3 ClearText Ce type de connexions conserve le nom et le mot de passe dans le package d’authentification, ce qui permet au serveur d’établir des connexions à d’autres serveurs réseau lors de l’emprunt d’identité du client.

Exemple

L’exemple suivant affiche la configuration BasicAuthenticationSection du site Web par défaut.

' 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  
  

Hiérarchie d'héritage

ConfigurationSection

BasicAuthenticationSection

Spécifications

Type Description
Client - IIS 7.0 sur Windows Vista
- IIS 7.5 sous Windows 7
- IIS 8.0 sous Windows 8
- IIS 10.0 sous Windows 10
Serveur - IIS 7.0 sur Windows Server 2008
- IIS 7.5 sur Windows Server 2008 R2
- IIS 8.0 sur Windows Server 2012
- IIS 8.5 sur Windows Server 2012 R2
- IIS 10.0 sous Windows Server 2016
Produit - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
Fichier MOF WebAdministration.mof

Voir aussi

Classe AnonymousAuthenticationSection
Classe AuthenticationSection
Classe ClientCertificateMappingAuthenticationSection
Classe DigestAuthenticationSection
Classe FormsAuthenticationConfiguration
Classe FormsAuthenticationCredentials
Classe FormsAuthenticationUser
Classe IisClientCertificateMappingAuthenticationSection
Classe PassportAuthentication
Classe WindowsAuthenticationSection
LogonUserEx