One of the challenges of managing a large Exchange Server environment is that you often need to support multiple versions of Exchange.
That means that often when you write a PowerShell script you need to account for servers running different versions and adjust accordingly. It can turn a simple scripting exercise into a big task.
Recently I was looking at ways to include our Exchange 2003 servers in some monitoring scripts that are already running for Exchange 2007/2010 servers. I wanted to perform a mail flow test for the Exchange 2003 servers, because that is a test that (if successful) very quickly confirms a lot of the elements involved in email availability are in fact healthy (ie the server is up, reachable, accepting SMTP connections, processing mail queues, the Information Store is running, and more).
For Exchange 2007/2010 the Test-Mailflow cmdlet can be used for these. You can build it into a health check script if you want to. But if you try to run it against an Exchange 2003 server you’ll get an error like this:
[PS] C:\>Test-Mailflow -Identity EX2007SERVER -TargetMailboxServer EX2003SERVER Test-Mailflow : "EX2003SERVER" is running a previous version of Exchange and does not support this task. At line:1 char:14 + Test-Mailflow <<<< -Identity EX2007SERVER -TargetMailboxServer EX2003SERVER + CategoryInfo : InvalidArgument: (:) [Test-Mailflow], OperationOnOldServerException + FullyQualifiedErrorId : 642F2C5C,Microsoft.Exchange.Monitoring.TestMailFlow
However, if the Exchange 2003 server is in the same organization you can use a different parameter with Test-Mailflow to achieve the same result. All you need is an email address for one of the mailboxes on the Exchange 2003 server. You might want to create a mailbox on each of your Exchange 2003 servers (or even each of the databases on those servers) specifically for this purpose.
Then you simply run the Test-Mailflow cmdlet with the -TargetEmailAddress parameter instead of the -TargetMailboxServer parameter.
[PS] C:\>Test-Mailflow -Identity EX2007SERVER -TargetEmailAddress EX2003SERVER_test@domain.com TestMailflowResult MessageLatencyTime IsRemoteTest ------------------ ------------------ ------------ Success 00:00:19.5014893 True
As you can see this is a nice, simple way to test your Exchange 2003 server health using PowerShell.