1

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 [email protected] as the sender, not the email address that was used when the email was sent.

Example:

Email sent to invalid address: [email protected]

Email sent back as Undeliverable from: [email protected]

I need to know that email sent to [email protected] was Undeliverable.

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

1 Answer 1

1

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

Get-Messagetrackinglog -Recipients: [email protected] -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
4
  • 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. Feb 20, 2013 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 "[email protected]" 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, 2013 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. Feb 20, 2013 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, 2013 at 16:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .