Skip to content

How to Start and Stop All Sites in IIS

Advertisement

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

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply

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


Back to top