关闭和开启Exchange 2010、2007、2003服务的命令脚本

关闭和开启Exchange 2010、2007、2003服务的命令脚本

关闭和开启Exchange 2010服务的命令脚本

net stop msexchangeadtopology /y
net stop msexchangefba /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y
net stop w3svc /y

#What does the script do?

net stop msexchangeadtopology /y
#Stops the "Microsoft Exchange Active Directory Topology Service" which will stop the following services

Microsoft Exchange Transport Log Search
Microsoft Exchange Transport
Microsoft Exchange Throttling
Microsoft Exchange Service Host
Microsoft Exchange Search Indexer
Microsoft Exchange RPC Client Access
Microsoft Exchange Replication
Microsoft Exchange Protected Service Host
Microsoft Exchange Mail Submission
Microsoft Exchange Mailbox Replication
Microsoft Exchange Mailbox Assistants
Microsoft Exchange File Distribution
Microsoft Exchange EdgeSync
Microsoft Exchange Anti-spam Update
Microsoft Exchange Address Book

It will also stop POP3, IMAP4 and Unified Messaging if those are enabled.

net stop msexchangefba /y
#stops the "Microsoft Exchange Forms-Based Authentication" service which does not have any dependencies

net stop msftesql-exchange /y
#stops the "Microsoft Search (Exchange)" service which does not have any dependencies

net stop msexchangeis /y
#stops the "Microsoft Exchange Information Store" service which does not have any dependencies

net stop msexchangesa /y
#stops the "Microsoft Exchange System Attendant" service which does not have any dependencies

net stop iisadmin /y
#stops the IIS admin service, which does not have any dependencies.

net stop w3svc /y
#stops the "World Wide Web Publishing" service, which may have any dependencies - on SBS this will also stop the Remote Desktop Gateway service, which could kick you out of the server if you are using the RWW to access the server.

If you are using a third party plug-in, then you may find that there is a dependency on that plug-in which can cause the script to fail. The /y at the end of each command should deal with it, but if you find that the third party service doesn't stop in time, adjust the script to include a delay. (Sleep is part of the Windows Resource Kit tools, if you don't have it installed on the server)

For example, this is a script used with an old version of McAfee Group Shield

net stop "McAfee GroupShield Exchange" /y
sleep 30
net stop msexchangefba /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y
net stop w3svc /y

Starting Exchange with a Script

Finally, you might also want a script to start Exchange again. This can be useful if you apply an update which requires a restart of the Exchange services, but don't need to restart the server. However starting the services is a little more complex as the less number of the services are dependant on other services. Therefore more services have to be started manually. Simply copy and paste it in to a new notepad document and save it as "start-exchange.cmd".

Remember to add POP3 and IMAP services if you are using those

net start "World Wide Web Publishing Service"
net start "Microsoft Exchange System Attendant"
net start "Microsoft Search  (Exchange)"
net start "Microsoft Exchange Information Store"
net start "Microsoft Exchange Unified Messaging"
net start "Microsoft Exchange Transport Log Search"
net start "Microsoft Exchange Transport"
net start "Microsoft Exchange Throttling"
net start "Microsoft Exchange Service Host"
net start "Microsoft Exchange Search Indexer"
net start "Microsoft Exchange RPC Client Access"
net start "Microsoft Exchange Replication"
net start "Microsoft Exchange Protected Service Host"
net start "Microsoft Exchange Mailbox Replication"
net start "Microsoft Exchange Mailbox Assistants"
net start "Microsoft Exchange Mail Submission"
net start "Microsoft Exchange Forms-Based Authentication service"
net start "Microsoft Exchange File Distribution"
net start "Microsoft Exchange EdgeSync"
net start "Microsoft Exchange Anti-spam Update"
net start "Microsoft Exchange Address Book"

http://exchange.sembee.info/2010/shutdown-script.asp

关闭Exchange 2007服务的命令脚本

net stop msexchangeadtopology /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y

What does the script do?

net stop msexchangeadtopology /y
#Stops the "Microsoft Exchange Active Directory Topology Service" which will stop the following services

Microsoft Exchange Unified Messaging
Microsoft Exchange Transport Log Search
Microsoft Exchange Transport
Microsoft Exchange Service Host
Microsoft Exchange Search Indexer
Microsoft Exchange Replication Service
Microsoft Exchange Mail Submission
Microsoft Exchange Mailbox Assistants
Microsoft Exchange File Distribution
Microsoft Exchange EdgeSync
Microsoft Exchange Anti-spam Update

It will also stop POP3 and IMAP4 if those are enabled.

net stop msftesql-exchange /y
#stops the "Microsoft Search (Exchange)" which does not have any dependencies

net stop msexchangeis /y
#stops the "Microsoft Exchange Information Store" which does not have any dependencies

net stop msexchangesa /y
#stops the Microsoft Exchange System Attendant which does not have any dependencies

net stop iisadmin /y
#stops IIS which will also stop the following services

World Wide Web Publishing Service
HTTP SSL

If you are using a third party plug-in, then you may find that there is a dependency on that plug-in which can cause the script to fail. The /y at the end of each command should deal with it, but if you find that the third party service doesn't stop in time, adjust the script to include a delay. (Sleep is part of the Windows Resource Kit tools, if you don't have it installed on the server)

For example, this is a script used with an old version of McAfee Group Shield

net stop "McAfee GroupShield Exchange" /y
sleep 30
net stop msexchangeadtopology /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y

Starting Exchange with a Script

Finally, you might also want a script to start Exchange again. This can be useful if you apply an update which requires a restart of the Exchange services, but don't need to restart the server. However starting the services is a little more complex as the less number of the services are dependant on other services. Therefore more services have to be started manually. Simply copy and paste it in to a new notepad document and save it as "start-exchange.cmd".

Remember to add POP3 and IMAP services if you are using those.

net start "World Wide Web Publishing Service"
net start "Microsoft Exchange Information Store"
net start "Microsoft Exchange System Attendant"
net start "Microsoft Search  (Exchange)"
net start "Microsoft Exchange Information Store"
net start "Microsoft Exchange Unified Messaging"
net start "Microsoft Exchange Transport Log Search"
net start "Microsoft Exchange Transport"
net start "Microsoft Exchange Service Host"
net start "Microsoft Exchange Search Indexer"
net start "Microsoft Exchange Replication Service"
net start "Microsoft Exchange Mail Submission"
net start "Microsoft Exchange Mailbox Assistants"
net start "Microsoft Exchange File Distribution"
net start "Microsoft Exchange EdgeSync"
net start "Microsoft Exchange Anti-spam Update"

http://exchange.sembee.info/2007/shutdown-script.asp

 

关闭和开启Exchange 2003服务的命令脚本

net stop "Microsoft Exchange Information Store" /y
net stop "Microsoft Exchange System Attendant" /y
net stop "Microsoft Exchange IMAP4" /y
net stop "Microsoft Exchange Routing Engine" /y
net stop "Microsoft Exchange POP3" /y
net stop "Microsoft Exchange Management" /y

If you are using a third party plug-in, then you may find that there is a dependency on that plug-in which can cause the script to fail. The /y at the end of each command should deal with it, but if you find that the third party service doesn't stop in time, adjust the script to include a delay. (Sleep is part of the Windows Resource Kit tools, if you don't have it installed on the server)

For example, this is a script used with an old version of McAfee Group Shield

net stop "McAfee GroupShield Exchange" /y
sleep 30
net stop "Microsoft Exchange Information Store" /y
net stop "Microsoft Exchange System Attendant" /y
net stop "Microsoft Exchange IMAP4" /y
net stop "Microsoft Exchange Routing Engine" /y
net stop "Microsoft Exchange POP3" /y
net stop "Microsoft Exchange Management" /y

Finally, you might also want a script to start Exchange again. This can be useful if you apply an update which requires a restart of the Exchange services, but don't need to restart the server.

net start "Microsoft Exchange Information Store"
net start "Microsoft Exchange System Attendant"
net start "Microsoft Exchange MTA Stacks"
net start "Microsoft Exchange IMAP4"
net start "Microsoft Exchange Routing Engine"
net start "Microsoft Exchange POP3"
net start "Microsoft Exchange Management"

http://exchange.sembee.info/2003/shutdown-script.asp

tag