title: Prevent IIS Site and/or app Pool from starting
body: <p>I have a Powershell script that puts a Windows 2012R2 IIS(v8.5) Web server in "maintenance mode" by stopping a site and its associated app pool. (<code>Stop-WebAppPool</code> and <code>Stop-Website</code> cmdlets).  However, if I run <code>iisreset</code> or reboot the server, that site and app pool are put back in a started state automatically.</p>
  
  <p>The Start Mode on the app pool is set to "OnDemand".
  "Preload Enabled" is set to False on the site.</p>
  
  <p>Here's the interesting part.  If I manually stop the site/pool using the IIS Mgmt Console, the stopped state "survives" an iisreset or server reboot.  So, there seems to be something fundamentally different between what the console does and what powershell/code does.</p>
  
  <p>I also tried using appcmd.exe commands instead of the PS cmdlets, same thing: Site and pool were automatically started after reset or reboot.</p>
  
  <p>Has anyone experienced this?  Any suggestions.  I need this site to remain stopped after an iisreset or reboot so that it doesn't become live while performing maintenance.</p>
  
  <p>Its a pretty basic site, so I've thought about just deleting and re-creating, but that seems a pretty extreme measure.  Hoping somebody has a less intrusive method.</p>