Remembering Thoughts
  Twitter GitHub RSS

Impersonation in Microsoft Dot Net

Usage

string domain = "ExampleDomain";
string userName = "ExampleUserName";
string password = "ExamplePassword"; 

using (Impersonation impersonation = new Impersonation(domain, userName, password))
{
 // impersonation occuring in here 
         Console.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
} 

Implementation


Published:

Share on Twitter