romaklimenko
3/28/2013 - 11:05 AM

How to stop IIS-site and do not start after reboot or iisreset

How to stop IIS-site and do not start after reboot or iisreset

using Microsoft.Web.Administration;

namespace IISSiteManager
{
  class Program
  {
    static void Main(string[] args)
    {
      var server = new ServerManager();

      foreach (var site in server.Sites)
      {
        site.ServerAutoStart = false;
        site.Stop();
      }
      server.CommitChanges();
    }
  }
}