title: C# Web Service Impersonation
body: <p>If I enable impersonation in a web service with identity="someID"... As web service is MTA application the impersonation that is applied may be applied to a worker thread and not the thread that actually call the method... I guess you might get an access denied error...Without problematically doing impersonation .. just by enabling it in webconfig .. what changes will i have to make to my function which does some clever stuff?</p>
  
  <pre><code>&lt;identity impersonate="true" userName="DomainName\UserName" 
                           password="ClearTextPassword" /&gt;
  </code></pre>
  
  <p>The <code>&lt;identity&gt;</code> element within Web.config supports optional user name and password attributes which allows you to configure a specific fixed identity for your Web service to impersonate. This is shown in the following configuration file fragment...
  what else do i need to write?</p>
  
  <pre><code>System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcesses(); 
  p.GetExccutiong();
  Console.WriteLine();
  </code></pre>