iisiis-7maintenance-mode

How to have one maintenance page for multiple IIS sites


We have all of our ColdFusion sites running through IIS and when we are upgrading ColdFusion we would like to be able to have a single maintenance page that will cover all of them.

How would you go about setting up a catch all for all pages on all sites on a server?

We can't do it using ColdFusion code because ColdFusion will be turned off for the upgrades.

I can only find aspx solutions for this sort of issue.


Solution

  • Setup a maintenance site in IIS which is assigned to all IPs and all ports that your sites are regularly on. You will not be able to have this site started when the other sites are.

    Write a script (PowerShell is the simplest) like this:

    # Stop each site
    C:\Windows\System32\inetsrv\appcmd stop site $siteName
    C:\Windows\System32\inetsrv\appcmd stop site $siteName2
    
    # Start Maintenance site
    C:\Windows\System32\inetsrv\appcmd start site $maintenanceSiteName