Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Exchange Server 2010

I am trying to use Powershell to get the email addresses that were returned as Undeliverable. I've tried a bunch of Powershell commands, but I always get the as the sender, not the email address that was used when the email was sent.


Email sent to invalid address:

Email sent back as Undeliverable from:

I need to know that email sent to was Undeliverable.

Is this possible? Does anyone know the correct Powershell command?

share|improve this question
up vote 1 down vote accepted

Well, the GUI tracking log is much easier to use...and gives you more details, but:

Get-Messagetrackinglog -Recipients: -EventID “FAIL” -Start “2/10/2013 8:00:00 AM” -End “2/20/13 8:00:00 AM” |ft Timestamp, Source, Sender, Recipients, MessageSubject >> C:\tracking.txt
share|improve this answer
That's not working for me. This is finding spam emails sent to the -Recipients. Is there a way to extract the email body? If I use -MessageSubject "Undeliverable" I find the emails sent from the postmaster, but the "mail to" email address is in the body. – RMAN Express Feb 20 '13 at 20:23
No, I don't think you can get email body. The powershell command is accurate though. I just sent a test email to "" and got the undeliverable. Then I ran the command with today's time parameters and got the right output showing that I was the sender and the hotmail account was the recipient. I'm not sure what else you are looking for at this point. Do you have an example you can lay out in detal? – TheCleaner Feb 20 '13 at 20:58
I think it is related to our email setup. When emails are sent they are forwarded to another email server that actually sends the email. Thanks for your help. – RMAN Express Feb 20 '13 at 21:38
Even with a smarthost you should still get this to work. Hopefully it helps steer you in the right direction. – TheCleaner Feb 21 '13 at 16:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.