다음을 통해 공유


Starting and Stopping Services

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You might need to restart IIS before certain configuration changes take effect or when applications become unavailable. You can restart IIS using the Restart IIS command in IIS Manager or by using the IISReset command-line utility. Both methods allow you to stop, start, and restart IIS Internet services, as well as reboot your computer.

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. For a list of features designed to improve IIS reliability and remedy the need to restart IIS, see Restarting IIS.

If the IISReset command-line utility is disabled, then the command-line or IIS Manager calls that require IISReset.exe will fail and return an error stating that IISReset is disabled. Actions that fail include the Restart IIS command in IIS Manager and Service Control Manager (SCM) recovery configuration actions that use the IISReset command-line utility (for example, the default IIS Admin SCM recovery path). However, SCM recovery actions that do not use the IISReset command-line utility continue to function (for example, the default World Wide Web Publishing Service SCM recovery path that restarts the WWW service).

Important

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".

Procedures

To restart IIS services

  1. In IIS Manager, right-click the local computer, point to All Tasks, then click Restart IIS.

  2. In the What do you want IIS to do drop-down list, click Restart Internet Services on computer name. You can also choose to reboot the computer, stop the Internet service, or start the Internet service.

  3. IIS attempts to stop all services before restarting.

To start, stop, or pause individual sites

  • In IIS Manager, right-click the site you want to start, stop, or pause; and click Start, Stop, or Pause.

To restart IIS by using the IISReset command-line utility

  1. From the Start menu, click Run.

  2. In the Open box, type cmd, and then click OK.

  3. At the command prompt, type the following:

    Iisreset /noforce ComputerName

    If you are logged on locally, the ComputerName parameter is not required. If you are remotely administering a server running IIS, the ComputerName parameter is the NetBIOS name of the computer on which you want to restart IIS.

    Important

    Use the /noforce parameter to help prevent data loss in case the IIS services cannot be stopped within the one minute time-out period. If you are certain that it is safe to force IIS to restart, you can omit the /noforce parameter. However, be aware that you could lose data if you do not include this parameter.

  4. IIS attempts to stop all services before restarting. The IISReset command-line utility waits up to one minute for all services to stop if you do not include the /noforce parameter. If the services cannot be stopped within one minute, all IIS services are terminated, and IIS restarts.

The iisreset command provides several additional parameters. For example, you can adjust the time-out value by using the iisreset/timeout command. For more information about the parameters that are available with the IISReset command-line utility, open a command-prompt window, and type iisreset /? at the command prompt.

For more information about starting and stopping services or using the IISReset command-line utility to restart IIS, see Restarting IIS in the IIS 6.0 Operations Guide, which is accessible from IIS Manager, and also see IIS 6.0 Administration Scripts, Tips, and Tricks in this reference.