IISRESET is a command-line tool in Windows 2000 that stops, unloads, reloads, and restarts the IIS process and all its attendant components on demand. It is useful as a way to kill and relaunch IIS in many circumstances: as part of a regularly-scheduled batch operation, as a way to insure that Registry and Metabase changes take hold, and as a response to performance monitor alerts in the event of an extreme memory leak.
Using IISRESET is simple enough. Type IISRESET from a command line, followed by a machine name or IP address if you are resetting a machine remotely. The program will respond with prompts that tell you the progress of the reset, which can take up to a couple of minutes in some cases. The default timeout period is 20 seconds for a restart, 60 seconds for a stop, and zero for a reboot, although you can modify these parameters.
You can also invoke IISRESET with a variety of switches. The default is /RESTART, which stops and then restarts all IIS services. If the services have been stopped and you want to start them again, use /START; if you want to just stop them with no restart, use /STOP.
Rreboot the system through IISRESET by using the /REBOOT switch. If you use /REBOOTONERROR, the system will reboot only if the stop/restart of IIS does not take place gracefully.
The /NOFORCE switch tells the program not to force the termination of the IIS processes; if the process does not terminate by itself, gracefully,
/STATUS reports back on the status of all loaded IIS services:
Status for World Wide Web Publishing Service ( W3SVC ) : Running
Status for FTP Publishing Service ( MSFTPSVC ) : Running
/ENABLE and /DISABLE allow you to enable and disabled the running of IIS on the system. This is useful if you are trying to debug something and want IIS to shut down and stay down through a reboot.
IISRESET can be used to kill and restart IIS in the event of a memory leakage alert. To set something like this up, right-click on My Computer, select Manage, go to Performance Logs and Alerts, and create a new alert. Add the appropriate system counter to monitor, such as system memory or processor time. Under the Action tab, select Run This Program and add IISRESET with the appropriate switches. In the same way, you can make IISRESET part of a scheduled batch job. (Note that if IIS is leaking memory on a regular basis, there may be a severe problem that needs to be addressed by adding Service Packs or updating either MDAC or the Scripting Engine.)
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter.
This was first published in September 2002