Restarting IIS (IIS 6.0)
You might need to restart Internet Information Services (IIS) before certain configuration changes take effect or when applications become unavailable. Restarting IIS is the same as first stopping IIS, and then starting it again, except it is accomplished with a single command. There are two ways to restart IIS:
Both methods allow you to stop, start, and restart IIS Internet services. The Restart IIS command in IIS Manager and the IISReset command-line utility do not restart the HTTP protocol stack (HTTP.sys) or Internet services outside of IIS. In previous versions of IIS, restarting IIS using the IISReset command-line utility was a common practice for recovering from an unresponsive application.
Restarting or stopping IIS, or rebooting your Web server, is a severe action. When you restart the Internet service, all sessions connected to your Web server (including Internet, FTP, SMTP, and NNTP) are dropped. Any data held in Web applications is lost. All Internet sites are unavailable until Internet services are restarted. For this reason, you should avoid restarting, stopping, or rebooting your server if at all possible. IIS 6.0 includes application pool recycling and several other features that provide alternatives to restarting IIS. For a list of features designed to improve IIS reliability and remedy the need to restart IIS, see "Alternatives to Restarting IIS" in this topic.
Changes to the metabase can be lost when restarting IIS. To avoid losing metabase changes and to trigger history files that back up the metabase, use the SaveData method. For more information about the SaveData method, see "SaveData" in the Platform SDK on MSDN.
With IIS 6.0, the World Wide Web Publishing Service (WWW service) lives in the service host, Svchost.exe. The FTP, NNTP, and SMTP services and the IIS metabase, known as the IIS Admin service, lives in Inetinfo.exe. If the IIS Admin service terminates abnormally, IIS restarts automatically. This feature is known as Automatic Restart. Previously, in IIS 5.0, if the IIS Admin service terminated abnormally, both the WWW service and IIS Admin service had to be restarted because they shared the same application space. In IIS 6.0, if the IIS Admin service terminates abnormally, the WWW service does not go down because the IIS Admin service and the WWW service run in separate process spaces. In this case, the WWW service acknowledges that the metabase has terminated abnormally and checks to see if the IISReset command-line utility is configured on the IIS Admin service. If IISReset is configured on the IIS Admin service, IIS waits for the IIS Admin service to start again and reconnects the WWW service.
All of the Internet services listed below, if installed, are affected when you restart IIS. Not all of the services listed below are installed by default.
You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /User:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".
To restart IIS using IIS Manager
If IIS is terminated before its services have stopped normally, data loss can result. If possible, back up your IIS configuration before restarting IIS. See Backing Up and Restoring the Metabase for information on backing up your IIS configuration.
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer\Administrator cmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any parameters).
To restart IIS using the IISReset command-line utility
You can adjust the timeout value using the iisreset /timeout command.
The IISReset command-line utility has several options available. For more information on the options available with the IISReset command-line utility, open a command-prompt window, and type iisreset /? You can also search for "iisreset" in Windows Help.
Automatic Restart is enabled by default for the IIS Admin service and WWW service. If a process within either service terminates abnormally, the service restarts automatically. The WWW service restarts using the net start command. The IIS Admin service restarts using the iisreset command. These commands are issued internally without user intervention. You can disable Automatic Restart using the following procedures.
To disable restart of IIS Admin service
The following command can only be issued on the local machine.
To disable restart of IIS Admin service from the command line
To re-enable the IIS Admin service, at the command prompt, type iisreset /enable, and press ENTER.
To disable restart of the WWW service
Alternatives to Restarting IIS
If you have to restart IIS often because of a faulty application, consider debugging or rewriting the application. To ensure that your applications do not interfere with other services and cause the need to restart IIS, it is recommended that you enable the following: