Exchange Server is highly interdependent with other services in Windows -- such as Active Directory. These interdependencies
become much more pronounced when Exchange is installed on a domain controller. One of the ways this can create problems (although not intractable ones) is during the shutdown process. Shutdown ungracefully, and you'll feel more pressure than you care to deal with from management that can't get its e-mails.
The shutdown order for system services can't be directly dictated, so a system that attempts to shut down the Active Directory services before Exchange will cause Exchange to throw a whole series of spurious errors and hold up the shutdown process for minutes—sometimes as much as half an hour or more. The errors in question are usually MSExchangeAL 8026 and 8250, and MSExchangeDSAccess 2104 and 2102—signs that the Exchange Server is trying (futilely) to contact the AD service to update user information.
Getting Exchange to shut down before Active Directory is not something you can do wholly automatically. One mechanism that might look like it affords a solution is to alter service dependencies, but dependencies don't govern the order in which services terminate—only the order in which they are launched. Another possible fix involves editing the WaitToKillServiceTimeout Registry entry (a REG_SZ entry, calibrated in milliseconds, and found in HKEY_LOCAL_MACHINESystemCurrentControlSetControl). This governs how long the system will wait for a service to terminate gracefully, which by default is 20 seconds. Increasing it to 60 seconds (or more if needed) may reduce the amount of cross-contention between services trying to shut down, but it may not help a system where for whatever reason Exchange is being shut down after Active Directory.
One way to solve this problem is to write a batch file that uses the NET STOP command to gracefully turn off the services in the proper order: Exchange first, then Active Directory (if needed). Since each command in the batch file has to be evaluated one at a time, this prevents other services from "jumping the gun". The last command in the batch file should be the SHUTDOWN command (available in Windows 2003 Server, and in the Windows 2000 Resource Kit), which will then invoke a shutdown for all other services and the system as a whole. Run the batch file as a way of shutting down the system, rather than invoking the usual Shutdown command.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check out his Windows 2000 blog for his latest advice and musings on the world of Windows network administrators – please share your thoughts as well!