title: How to give permission for recycle application pool in iis 7(without providing admin credentials) using c#
body: <pre><code>string app_Path = "IIS://localhost/W3SVC/AppPools/Application pool name";
  DirectoryEntry app_pool = new DirectoryEntry(app_Path);
  app_pool.Invoke("Recycle");
  </code></pre>
  
  <p>I'm using above code and I'm getting rid of this particular thing where I cannot recycle the application pool in IIS7 through c# whilst I'm running this code through web server.</p>
  
  <p>This gets strucks when it comes to the invoke method because of permission issue and throwing this below exception.</p>
  
  <pre><code>     Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
  </code></pre>
  
  <p>how to come out of this and how can i give permission without admin credentials.And also i tried in web config file by giving impersonate is true for identity tag but no use.How to fix it and what is the solution?</p>
  
  <p>Thanks,</p>
  
  <p>Harish Jay</p>