Impersonation and DirectoryEntry
问题 I am impersonating a user account successfully, but I am not able to use the impersonated account to bind to AD and pull down a DirectoryEntry . The below code outputs: Before impersonation I am: DOMAIN\user After impersonation I am: DOMAIN\admin Error: C:\Users\user\ADSI_Impersonation\bin\Debug\ADSI_Impersonation.exe samaccountname: My issue seems similar to: How to use the System.DirectoryServices namespace in ASP.NET I am obtaining a primary token. I understand that I need to use