WindowsAccountType Enumeration


Specifies the type of Windows account used.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

public enum WindowsAccountType

Member nameDescription

An anonymous account.


A Windows guest account.


A standard user account.


A Windows system account.

The WindowsAccountType enumeration is used by the WindowsIdentity class.

The following example shows how to use the WindowsIdentity constructor to create a new instance of the WindowsIdentity class for the user represented by the specified Windows account token, the specified authentication type, and the specified Windows account type. This code example is part of a larger example provided for the WindowsIdentity class.

private static void IntPtrStringTypeConstructor(IntPtr logonToken)
    // Construct a WindowsIdentity object using the input account token,
    // and the specified authentication type, and Windows account type.
    string authenticationType = "WindowsAuthentication";
    WindowsAccountType guestAccount = WindowsAccountType.Guest;
    WindowsIdentity windowsIdentity =
        new WindowsIdentity(logonToken, authenticationType, guestAccount);

    Console.WriteLine("Created a Windows identity object named " +
        windowsIdentity.Name + ".");

.NET Framework
Available since 1.1
Return to top