Chris's coding blog

Starting and stopping all IIS sites in Powershell

November 17, 2014

This is just a boring Powershell 4 snippet for starting and stopping IIS websites:

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

Chris Small

I'm Chris Small, a software engineer living and working in London. This is my tech blog. Find out more via GithubStackoverflowResume