ASPNetFAQ.com: What is ASP.NET?

Technology posts on ASP.NET, IIS, Windows (+ a little Linux), Cloud Servers, Hosting, and more!
  • Blog Home
Search the site...

Stopping All Sites on a Windows Server Without Stopping IIS

Tweet
Share
0 Shares

I had a need recently to stop all the sites running on a Windows server, but I didn’t want to stop IIS. This specific server has hundreds of sites running on it, so stopping each one at a time would have taken an excessive amount of time.

So with a little Google-fu I stumbled across an old post that leverages appcmd

c:\windows\system32\inetsrv\appcmd.exe list site /xml /state:"$=started" | appcmd stop site /in

This single command will pull a list of all the sites that currently have a running state of “started” and then pipe that list into the stop command. This runs super-fast even on a server with hundreds of sites – very impressive and using this saved me tons of time!

Happy IIS hosting! :)

By the way, here’s the inverse of this script to restart all the sites on an IIS server.

More from my site

  • IIS7 Application Pool Idle Time-out SettingsIIS7 Application Pool Idle Time-out Settings
  • Convert a Folder to an Application on a Remote IIS HostConvert a Folder to an Application on a Remote IIS Host
  • Basic IIS Performance StatisticsBasic IIS Performance Statistics
  • Linking spam sent through shared IIS SMTP server to a userLinking spam sent through shared IIS SMTP server to a user
  • PUT/POST/DELETE Verb Errors On SitePUT/POST/DELETE Verb Errors On Site
Tweet
Share
0 Shares
Hosting, IIS, System Administration

One comment on “Stopping All Sites on a Windows Server Without Stopping IIS”

  1. Francis says:
    January 3, 2015 at 8:42 am

    Thanks a lot Brad! Nice and useful IIS tip! Keep it up.

Proverbs 19:20

"Get all the advice and instruction you can, so you will be wise the rest of your life."

A Note On WordPress Hosting

Our main focus is of course .NET, but with a mix of Linux, virtualization, and other technologies. But if you're really looking for the best WordPress hosting specifically, read my WordPress host review to save yourself hassle AND money!




Recent Posts

  • What makes good web hosting?
  • jQuery Mobile C# ASP.NET and N5 Networks Software Repository
  • Open Source Bug Tracking Software and the Orchard Project
  • ASP.NET Development with Dreamweaver MX: Visual QuickPro Guide
  • Kendo UI Sample, ASP.NET Ajax Tutorial & More

Tags

ASP.NET Automation centos CMS css cytanium Development/Coding Email gmail Hosting htaccess http https IIS javascript Learning Linux logparser MySQL nginx openssl OrcsWeb performance PowerShell redirect RHEL security server SherWeb smtp SQL/Databases ssl System Administration telnet terminal tip Troubleshooting Ubuntu virtualization Visual Studio web farm web hosting Windows windows server Wordpress

Categories

  • ASP.net development
  • Development/Coding
  • Hosting
  • IIS (Internet Information Services)
  • SQL/Databases
  • System Administration
  • Virtualization
(c) ASPNETFAQ.com