Managing IIS from the command line
Managing IIS from the command line
Submitted by Brent Strange on Sun, 05/03/2006 - 05:32.While testing Web applications I naturally find myself constantly messing with IIS. Stopping, starting, clearing logs, etc. As with most applications, it can be so much quicker and easier to do things from the command line. Recently while performance testing I was constantly needing to Stop and start IIS as well as recycle the application pool. Here are those commands for Server 2003:
To stop the web server:
net stop w3svc
To start the Web server:
net stop w3svc
To stop and start the Web server:
iisreset
To recycle the application pool:
iisapp /p <PID> /r
iisapp /a <App_Pool_ID> /r
If you're not sure what the PID or App_Pool_ID is then just use the command iisapp with no switches to print the list.
