WindowsAccountType Enum

Definition

Specifies the type of Windows account used.

C#
public enum WindowsAccountType
C#
[System.Serializable]
public enum WindowsAccountType
C#
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
C#
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
Inheritance
WindowsAccountType
Attributes

Fields

Name Value Description
Normal 0

A standard user account.

Guest 1

A Windows guest account.

System 2

A Windows system account.

Anonymous 3

An anonymous account.

Examples

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.

C#
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 + ".");
}

Remarks

The WindowsAccountType enumeration is used by the WindowsIdentity class.

Applies to

Product Versions
.NET 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5