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.
Comments
- Anonymous
January 01, 2003
Thanks - Anonymous
April 29, 2014
Only works if you're running from C:Windowssystem32inetsrv
To have it work from anywhere:
c:windowssystem32inetsrvappcmd.exe list site /xml /state:"$=started" | c:windowssystem32inetsrvappcmd.exe stop site /in
yep. thx. regards, Bernhard