QAInsight.net, QABlog.com, QABlog.net
Brent Strange's thoughts on Software Quality Assurance and technology

 
Sunday, March 05, 2006
 
 

Managing IIS from the command line

 
 

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.