4.2. Starting and Stopping Exchange

Problem

You want to manually start or stop the Exchange services without rebooting the computer that hosts them.

Solution

Using a graphical user interface

To stop, start, pause, or restart an individual virtual server, do the following:

  1. Log on to the Exchange server using an account that has administrative privileges on the local computer.

  2. Launch the Exchange System Manager (Exchange System Manager.msc).

  3. Expand the Administrative Groups node, then the administrative group that contains the server whose services you want to twiddle.

  4. Expand the server and open its Protocols container.

  5. Expand the protocol node that contains the virtual server you want to stop, pause, or restart.

  6. Right-click the selected virtual server.

  7. Choose the desired command (Stop, Pause, or Start) from the context menu.

  8. Wait for the service status to update.

To stop, start, pause, or restart a service, do the following:

  1. Log on to a server or workstation in your domain, using an account that has administrative privileges on the server where you're trying to start or stop Exchange.

  2. Open the Services snap-in (services.msc). If you're not logged in to the target computer, right-click the Services (local) node in the left pane and use the Connect to another computer command to connect to the target server.

  3. Locate the service that you want to start, stop, or pause. To stop all Exchange services, the easiest method is to stop the Microsoft Exchange System Attendant Service, although you can stop other services (see Table 4-1).

  4. Change the service state by right-clicking the service and choosing a command, using the toolbar icons at the top of the Services snap-in, or choosing a command from the Action menu.

Table 4-1. Exchange services and their dependencies

Service

Short name

What it does

Depends on

Default startup state

System attendant

MSExchangeSA

Provides monitoring and controls interfaces for other services

Event Log, NTLM Security Support Provider, RPC, Server, Workstation services

Automatic

Routing engine

RESvc

Maintains link state/routing table data

IIS admin

Automatic

Information store

MSExchangeIS

Provides access to storage groups, databases, mailboxes

System attendant

Automatic

IIS core

W3Svc

HTTP/HTTPS publishing, OWA

IIS Admin

Automatic

SMTP service

SMTPSvc

Inbound and outbound SMTP message flow

IIS Admin

Automatic

IMAP service

IMAP4Svc

IMAP access for end users

IIS Admin

Automatic (Exchange 2000) or disabled (Exchange Server 2003)

POP3 service

POP3Svc

POP access for end users

IIS Admin

Automatic (Exchange 2000) or disabled (Exchange Server 2003)

MTA stacks

MSExchangeMTA

X.400 MTA for X.400 connectors or mixed 5.5 organizations

System attendant

Automatic

Site replication service

MSExchangeSRS

Topology discovery and replication for mixed-mode organizations

none

Disabled; only enabled when needed for Exchange 5.5 compatibility

Event service

MSExchangeES

Backward compatibility with Exchange 2000 event scripts

Information store

Manual

Management service

MSExchangeMGMT

Hosts WMI providers for message tracking and DSAccess

RPC, Windows Management Instrumentation services

Automatic

IIS Admin service

IISADMIN

 

Protected Storage, RPC services

Automatic

NNTP service

NNTPSvc

NNTP feeds, public folder administration

IIS Admin

Manual

Using a command-line interface

To stop the Exchange services locally, log on to the Exchange server with an account that has administrative privileges, and run the following command:

> net stop <serviceName>

If you want to stop services on a remote machine, you can use the sc ("service control") command with the stop switch:

> sc <computerName> stop <serviceName>

A complete script to stop all of the Exchange and IIS services would look like this (the /Y switch forces the service control manager to stop the service and any dependent services that have not yet stopped):

net stop MSExchangeES
net stop IMAP4Svc
net stop POP3Svc
net stop RESvc
net stop MSExchangeSRS
net stop MSExchangeMGMT
net stop MSExchangeMTA
net stop MSExchangeIS   /Y
net stop MSExchangeSA   /Y
net stop SMTPSvc
net stop W3Svc
net stop IISAdmin /Y

However, you can cheat by just stopping the Exchange system attendant (net stop msexchangesa /y); since the information store depends on it, that will cleanly shut down the IS and dismount your databases. The other services, like the routing engine and SMTP service, won't be affected by this.

Discussion

Starting and stopping the Exchange services is not often necessary. Generally, you only need to stop the services if you're performing some kind of maintenance, like an offline defragmentation (described in Recipe Recipe 6.16). In a few cases, you'll have to stop and restart one service or another (usually either MSExchangeIS or W3SVC) to force it to take notice of some parameter you've changed in Active Directory or the registry. For example, you have to stop and restart the routing engine service to get it to reload its link state table from another server in its routing group.

Another, more significant, case where you might need to manually stop the Exchange services is when you're running Exchange Server 2003 on a domain controller that is also a global catalog server. In this case, the AD services can shut down before the Exchange DSAccess component, in which case the DSAccess shutdown will wait, for up to 10 minutes, before giving up and shutting down. To avoid this wait, you can shut down the Exchange services before shutting down the server itself.

Table 4-1 lists the Exchange services; along with the common service name, it lists the short names of the services. You can use either format to start or stop services via the command line. It also lists the dependent services for each service. The fastest way to cleanly shut down an Exchange server is to stop the MSExchangeSA service; before the system attendant stops, it will shut down the information store (which in turn forces the IS to flush its transaction logs to disk, dismount all mounted databases, and write the special database header pages that indicate that the databases were cleanly dismounted).

See Also

Recipe 2.8 for running Exchange on a domain controller or global catalog server; MS KB 246287 (How to Write a Batch File to Shut Down Exchange Server Quickly), and MS KB 829361 (Exchange Server 2003 Computer Takes Longer Than You Expect to Shut Down); Chapter 2 of the Exchange Server 2003 Technical Reference Guide for more on the Exchange services and their dependencies

Get Exchange Server Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.