Share via


AuthenticationLogonMethod Enum

Definition

Specifies the kind of authentication that you can use to establish a logon session for a secured virtual directory.

public enum class AuthenticationLogonMethod
public enum AuthenticationLogonMethod
type AuthenticationLogonMethod = 
Public Enum AuthenticationLogonMethod
Inheritance
AuthenticationLogonMethod

Fields

Name Value Description
Interactive 0

Allows a user to log on interactively with the Web server. The underlying call to the LogonUser function caches credentials for disconnected operations.

Batch 1

Allows processes to execute on behalf of a user without the user's direct intervention. The user must have user rights to log on as a batch job (used, for example, by COM+ applications). This logon type is intended for applications where logon performance is very important. The underlying call to the LogonUser function does not cache credentials for a user logged in with the Batch logon type.

Network 2

Allows a user to log on to a remote server on the network. This AuthenticationLogonMethod logon type is intended for high-performance servers to authenticate clear-text passwords. The underlying call to the LogonUser function does not cache credentials for this logon type.

ClearText 3

Allows a user who has only network user rights to log on with clear-text credentials. The server can accept the user credentials, call the LogonUser function, verify that the user can access the Web server across the network, and still communicate with other servers by using the stored clear-text credentials.

Examples

The following example creates a new application under the default Web site. The example then configures the application's default virtual directory to use batch authentication to log on to a UNC path.


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationAuthenticationLogonMethod
    {
        // Creates a new virtual directory and sets the logon method.
        public void SetLogonMethod()
        {
            ServerManager manager = new ServerManager();
            Site defaultSite = manager.Sites["Default Web Site"];
            Application reports = defaultSite.Applications.Add(
                "/reports", @"\\FileServer\Reports");

            // Configure the default virtual directory for the application.
            VirtualDirectory reportDir = reports.VirtualDirectories[0];
            reportDir.LogonMethod = AuthenticationLogonMethod.Batch;
            reportDir.UserName = @"HumanResources\Jane";
            reportDir.Password = @"iL@1Fnw!";

            manager.CommitChanges();
        }
    }
}

Remarks

You would typically use these logon modes when a virtual directory is mapped to a UNC path.

Applies to