Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WindowsIdentity.ImpersonationLevel Property

Gets the impersonation level for the user.

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

[ComVisibleAttribute(false)]
public TokenImpersonationLevel ImpersonationLevel { get; }

Property Value

Type: System.Security.Principal.TokenImpersonationLevel
One of the enumeration values that specifies the impersonation level.

Describes the impersonation level to be used to connect to WMI.

The following code example shows the use of the ImpersonationLevel property to display the impersonation level for the current user. This code example is part of a larger example provided for the WindowsIdentity class.

TokenImpersonationLevel token = windowsIdentity.ImpersonationLevel;
Console.WriteLine("The impersonation level for the current user is : " + token.ToString());

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft