IIS commands

A couple of command line programs that allow you to start/stop/restart etc etc IIS and the www service especially when you are having some problems.

First “net” command

It can be used for any service and or account setup etc etc but it really works well for the www service the command would be “net stop w3svc”. I have included all of the usage below.

NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]

Second “iisreset”

This one is good if you need to stop/start etc etc all of the services that IIS needs

The command would be iisreset /stop -y the “-y” is there to say yes to all of the services other wise you would have to sit there and press y.  Below is the full usage.

Usage:
iisreset [computername]

/RESTART Stop and then restart all Internet services.
/START Start all Internet services.
/STOP Stop all Internet services.
/REBOOT Reboot the computer.
/REBOOTONERROR Reboot the computer if an error occurs when starting, stopping, or restarting Internet services.
/NOFORCE Do not forcefully terminate Internet services if attempting to stop them gracefully fails.
/TIMEOUT:val Specify the timeout value ( in seconds ) to wait for a successful stop of Internet services. On expiration of this timeout the computer can be rebooted if the /REBOOTONERROR parameter is specified. The default value is 20s for restart, 60s for stop,
and 0s for reboot.
/STATUS Display the status of all Internet services.
/ENABLE Enable restarting of Internet Services on the local system.
/DISABLE Disable restarting of Internet Services on the local system.

 

Leave a Reply