title: How to enable Windows Authentication on a Windows Server 2012 IIS website using Powershell?
body: <p>From end-to-end, how does one go about setting Windows Authentication on a ASP.NET app in Windows Server 2012?</p>
  
  <p>In earlier versions of IIS, you could just set <code>&lt;authentication&gt;</code>, <code>&lt;identity&gt;</code>, and <code>&lt;authorization&gt;</code> settings in the <code>Web.Config</code> and be done with it.</p>
  
  <pre><code>&lt;!-- Web.Config --&gt;
  &lt;system.web&gt;
    ...
    &lt;authentication mode="Windows /&gt;
    &lt;identity impersonate="false /&gt;
    &lt;authorization&gt;
      &lt;allow users="DOMAIN\user1" /&gt;
      &lt;allow users="DOMAIN\user2" /&gt;
      &lt;deny users="*" /&gt;
    &lt;/authorization&gt;
  </code></pre>
  
  <p>Now there is an extra security component that requires you to enable authentication on the IIS site/webapp itself.</p>
  
  <p>I'm scripting a bootstrap for our Window Server 2012 webserver, how to go about completing the configuration for IIS in Powershell?</p>
  
  <p><strong>NOTE: I'll be providing a self answer.</strong></p>