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
public static WindowsIdentity GetCurrent();
public: static WindowsIdentity* GetCurrent();
public static function GetCurrent() : WindowsIdentity;

Return Value

A WindowsIdentity object that represents the current user.


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


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