Поделиться через


NDR message caused by delegate

One question that comes up often is "Why did I get this undeliverable message (NDR) when I send a meeting request to this user?" Even better than the question is tracking down the answer. I always like to script common tasks like this so I wrote the following PowerShell script. This script requires a copy of the NDR message.

$start = Read-Host "Enter the start time"
$subject = Read-Host "Enter the message subject"
$hub = Read-Host "Enter the transport server"
$mbx = Read-Host "Enter the mailbox server"
$mid = Read-Host "Enter the message ID"

$start = [datetime]$start
$end = $start.AddMinutes(10)

$messages = Get-MessageTrackingLog -Server $mbx -Start $start -End $end -MessageSubject $subject -MessageId $mid -ResultSize unlimited | Where { $_.SourceContext.Contains("MessageClass:IPM.Schedule.Meeting.Request") -eq $True -And $_.Server.Hostname -ieq $hub }
foreach($m in $messages)
{ $startChar = $m.SourceContext.IndexOf("Mailbox:") + 8;
$mbx = $m.SourceContext.Substring($startChar,36);
Get-Mailbox $mbx }