Thursday, April 24, 2014

Exchange Server 2013 Email Flow Latency Script for multiple Servers

This script help for finding email flow latency between the servers. This will be most useful when you have the exchange servers across the site and perform the mail flow routing.

It works on getting the local server name as source server name and queries each target mailbox servers which is denoted in the array.

$filePath = "C:\temp\Raji\output.txt"
$array = @("MBX1.mail.com","MBX2.mail.com ","MBX3.mail.com ","MBX4.ad.aricent.co.mail.com")
$SourceServer = $env:COMPUTERNAME
ForEach ($TargetServer in $array)
{
Write-host Testing Mailflow from $SourceServer to $TargetServer -foregroundcolor cyan
Add-Content $filePath "Testing Mailflow from $SourceServer to $TargetServer"
$Output = Test-Mailflow -SourceMailboxServer $SourceServer -TargetMailboxServer $TargetServer | FT -Autosize
Write-Output $Output
$Output | Out-File -filePath $filePath -append -encoding ASCII
}
 
Just change the File path in the Email Flow Script and you can get the output as out.txt file

No comments:

Post a Comment

The blog is written to the share the knowledge mainly on Microsoft Exchange Server and other Microsoft product that experienced on day-to-day life.