Find emails with specific subject via Exchange management shell (Powershell) in Exchange 2007 and 2013

 

I have recently needed to find out if an email with specific subject ever hit our Exchange servers or not. Using  Meesage Tracking via Toolbox was not an option, given that we have number of exchange servers and email boxes across several  Exchange 2007 and Exchange 2013 SP1 servers.

After some searching on Technet forums and via Google, I ended up with the following Powershell commands. The commands were ran under Exchange 2007 Exchange management shell. I did not need to run it seperately on Exchange 2013 servers, it pulled the logs from both; Exchange 2007 and Exchange 2013 SP1 servers.

1)  Get all the transport servers, then get all the message logs, and find emails with Subject of “Some Subject” -or  “Some other subject” , and export it to a csv file

 

2)  Get all the transport servers, then get all the message logs, and find emails with Subject of “Some Subject” -or  “Some other subject” ,   from  “5/25/2015 12 :01:00 PM” TO “5/26/2015 11 :01:00 PM”  and  Recipient is “Recepient1@labs.shaulov.us” and export it to a csv file

 

3) Get all the transport servers, then get all the message logs, and find emails with Subject of “Some Subject” -or  “Some other subject” ,   from  “5/25/2015 12 :01:00 PM” TO “5/26/2015 11 :01:00 PM”  and  Sender  is Sender1@labs.shaulov.us 

 

 

 

Links:

http://exchangeserverpro.com/searching-message-tracking-logs-by-email-subject/

http://www.msexchange.org/kbase/ExchangeServerTips/ExchangeServer2010/Powershell/WhydoIgetSystem.StringwhenusingGet-MessageTrackingLogandexportingtoaCSV.html

Please follow and like us: