Skip to content

How to Start and Stop All Sites in IIS

Category
Web Servers
Covers
IIS
On this page

Internet Information Service (IIS) is the popular web server developed by Microsoft Corporation. It runs on Windows servers and serve websites to users. The PowerShell is the configuration and management application for the Microsoft systems. In this tutorial you will learn how to enable (start) or disable (stop) all sites in single command with PowerShell.

Useful links:

Launch PowerShell

Type PowerShell in application search option. Then right click on PowerShell application and select “Run as administrator”. This will provide you administrative privileges to perform actions.

Launch powershell as administrator

Start or Stop All Sites in IIS

The WebAdministration module provides the methods to manage IIS on windows system. So first, import WebAdministration module on Powershell, then run the following commands to start or stop all IIS sites.

Stop all sites

Import-Module WebAdministration
Get-ChildItem -Path IIS:\Sites | foreach { Stop-WebSite $_.Name; }

Start all sites

Import-Module WebAdministration
Get-ChildItem -Path IIS:\Sites | foreach { Start-WebSite $_.Name; }

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top