Visual Basic (Usage) | ![]() |
---|---|
Dim identityToken As UserNameSecurityToken Dim interactive As Boolean Dim value As ImpersonationContext value = UserIdentity.LogonUser(identityToken, interactive) |
C# | |
---|---|
public static ImpersonationContext LogonUser( UserNameSecurityToken identityToken, bool interactive ) |
Parameters
- identityToken
- The identity token.
- interactive
- Whether to logon interactively (slow).
Return Value
The impersonation context (must be disposed to reverse impersonation).Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x