Export (0) Print
Expand All
Expand Minimize

AuthenticationLogonMethod Enumeration

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

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public enum AuthenticationLogonMethod

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

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();
        }
    }
}



Community Additions

ADD
Show:
© 2014 Microsoft