title: Clone/Duplicate/Copy an Existing Application Pool in IIS 7
body: <p>In PowerShell one can clone an existing IIS 7 application pool to a new application pool, retaining all the source pools settings in the new pool.  Like this...</p>
  
  <pre><code>import-module webadministration
  copy IIS:\AppPools\AppPoolTemplate IIS:\AppPools\NewAppPool -force
  </code></pre>
  
  <p>Now I would like to do the same thing in C# using the classes in the Microsoft.Web.Administration namespace.  I have browsed the namespace and I cannot find a way to do this easily.  There is the MemberwiseClone method that I could call to create a shallow copy of the existing app pool, but I don't know if that would duplicate all the original app pools properties.  </p>
  
  <p>Can anyone help?</p>