Share via


How to stop all running IIS sites from the command line using appcmd with pipe (single line)

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

results in:

"Default Web Site" successfully stopped
"myothersite" successfully stopped              

stopping all running websites on an IIS7 server.