Maintaining a Highly Available Exchange 2010 Environment
In this article, I will walk you through how to keep your Exchange 2010 environment healthy and prevent down time. By maintaining your system proactively, searching for issues before they occur is the key to your Exchange 2010 uptime. I will cover various part of Exchange that has major impact on the mailflow, important logs and powershell cmdlets you can use to test the health of your Exchange 2010 server. In the end, I will also go over the techniques you can use to loadtest the servers using MS tools. If your title is Exchange administrator or Windows Administrator, your number one goal is to keep the messaging infrastructure running with minimal down time. This involves proactively monitoring the system instead of reactively fighting fires. Exchange 2010 is a complicated system and it’s important to keep messages flowing internally and externally. This is your number one goal. If possible, you want to use best practices in your environment when making changes to any Exchange 2010 components.
Monitoring the Hub Transport and Mail Gateway Message Queues
As I stated earlier how it’s important to keep messages flowing internally and externally out of Exchange 2010. This involves monitoring the messages queues. When email message cannot be routed in next hop, Exchange hub transport server will automatically queue the message. For example, if a user sends an email to yahoo.com, if exchange cannot reach yahoo.com servers, this message will queue on the hub transport server. You can use Queue Viewer within Exchange Management Console, under Exchange 2010 programs group to monitor the hub transport message queues. To access Queue viewer:
- Logon to your Exchange 2010 Hub Transport server.
- START > PROGRAM FILES > EXCHANGE 2010 > EXCHANGE MANAGEMENT CONSOLE
- Under toolbox, click on Queue Viewer.
From here, you can check how many messages are queued for which domain. Also, it will give a reason why a messages are queued allowing admins to troubleshoot the issue. Also you can take action on mail queues from this toolbox.
-
Suspend the message – this suspend the message queue and freezes the queue. This stops inbound and outbound messages out of this queue.
-
Remove the message – this remove the message the queue. This is help when you have a lot of message stuck in the queue and it is taking up resources. Also, you can choose to send NDR message to the sender when removing the message out of the queue.
-
Export the message – as it states, this simply makes a copy of the message you choose from queue.
-
Resubmit the message – this function simply resubmit the message. You can use this function when network connection to destination domain is fixed and you need to resubmit the messages.
Now, I will go over how you can manage the message queues using PowerShell and Exchange Management Shell. To Access Exchange management Shell:
- Logon to your Exchange 2010 Hub Transport server.
- START > PROGRAM FILES > EXCHANGE 2010 > EXCHANGE MANAGEMENT SHELL
When troubleshooting mailflow issues, first thing you want to do is view all messages queues on hub transport server. To do this, run:
Get-Queue –Server hubservername
This will return all available message queues on the server and allow you to review which queue has problems. To view the messages within the queue to determine the sender and recipient, run:
Get-message –queue “server\queuename”
You can also remove unwanted messages in the queue by running:
Get-message –queue “server\queuename” | remove-message
You may also retry the queue by running:
Get-Queue –Server hubservername | retry-queue
Resolving Mail-flow issues
There will be times users will complain the mails are not getting delivered in timely manner and you as an Exchange admin need to investigate. Exchange 2010 Tracking Log Explorer can be used to track mail messages and its delivery status. You can use this tool to search through Exchange message tracking logs and investigate precisely what happened to the message. To access Exchange 2010 Tracking Log explorer:
- RDP to Exchange 2010 Hub Transport Server.
- Go to START > PROGRAM FILES > EXCHANGE 2010 > EXCHANGE MANAGEMENT CONSOLE
- Go to Toolbox, click on Tracking Log Explorer
- From here, you can use various parameters to search for the message.
You may also track messages from Exchange 2010 Management Shell. To access the management shell:
- Logon to your Exchange 2010 Hub Transport server.
- START > PROGRAM FILES > EXCHANGE 2010 > EXCHANGE MANAGEMENT SHELL
- Run below command to view messages
Get-MessageTrackingLog –Server ex01 –messageSubject “who goes there”
Getting more verbose logs out of Exchange 2010
There are times you need more information than existing application log. You can configure Exchange 2010 to log as much details as you need. This comes with a cost of log space and clutter in the application log. To turn up verbose logging on Exchange Server:
- Log on to your Exchange 2010 server.
- START > PROGRAM FILES > EXCHANGE 2010 > EXCHANGE MANAGEMENT SHELL
- Run below command to get existing log level
Get-eventloglevel - Run below command to set logging level
Set-eventloglevel
Be sure to turn off logging once you are done troubleshooting.
Builtin Exchange Troubleshooting cmdlets
-
Test-ServicesHealth
This command will automatically check if required services are running for this particular role. -
Test-ActiveSyncConnectivity
This test activesync devices and attempt to sync with the mailbox you dictate. -
Test-EcpConnectivity
This simply test your Exchange control panel connectivity. -
Test-EdgeSyncronization
Test connectivity to Edge Transport servers from Hub Transport Server. -
Test-FederationTrust
simply test the federation gateway. -
Test-Imapconnectivity
Test imap clients. -
Test-Popconectivity
Test pop clients. -
Test-mailflow
Tests mailbox flow between internal Exchange Servers - Test-OutlookConnectivity
Test connectivity by accessing mailbox via autodiscover.
