WindowsAccountType Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the type of Windows account used.
public enum class WindowsAccountType
public enum WindowsAccountType
[System.Serializable]
public enum WindowsAccountType
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
type WindowsAccountType =
[<System.Serializable>]
type WindowsAccountType =
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType =
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType =
Public Enum WindowsAccountType
- Inheritance
- 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.
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 = gcnew WindowsIdentity( logonToken,authenticationType,guestAccount );
Console::WriteLine( "Created a Windows identity object named {0}.", windowsIdentity->Name );
}
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 + ".");
}
Private Sub IntPtrStringTypeConstructor(ByVal logonToken As IntPtr)
' Construct a WindowsIdentity object using the input account token,
' and the specified authentication type and Windows account type.
Dim authenticationType As String = "WindowsAuthentication"
Dim guestAccount As WindowsAccountType = WindowsAccountType.Guest
Dim windowsIdentity As _
New WindowsIdentity(logonToken, authenticationType, guestAccount)
WriteLine("Created a Windows identity object named " + _
windowsIdentity.Name + ".")
End Sub
Remarks
The WindowsAccountType enumeration is used by the WindowsIdentity class.