This documentation is archived and is not being maintained.

WindowsIdentity.GetCurrent Method

Returns a WindowsIdentity object that represents the current Windows user.

[Visual Basic]
Public Shared Function GetCurrent() As WindowsIdentity
[C#]
public static WindowsIdentity GetCurrent();
[C++]
public: static WindowsIdentity* GetCurrent();
[JScript]
public static function GetCurrent() : WindowsIdentity;

Return Value

A WindowsIdentity object that represents the current user.

Exceptions

Exception Type Condition
SecurityException The caller does not have the correct permissions. See the requirements section.

Requirements

Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

WindowsIdentity Class | WindowsIdentity Members | System.Security.Principal Namespace

Show: