This documentation is archived and is not being maintained.

WindowsAccountType Enumeration

Updated: May 2010

Specifies the type of Windows account used.

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

public enum WindowsAccountType

Member nameDescription
NormalA normal user account.
GuestA Windows guest account.
SystemA Windows system account.
AnonymousAn anonymous account.

The WindowsAccountType enumeration is used by the System.Security.Principal.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 + ".");

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0




May 2010

Added remarks and an example.

Customer feedback.