Exchange 2010 SMTP Logs PowerShell Script


Script to export the Exchange 2010 SMTP logs into an easy to "read and work with" Excel file:

1.  Load Exchange Management Shell:

add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010

2.  Export message tracking results to CSV:

get-messagetrackinglog -resultsize unlimited -Sender "user@sender.com" -MessageSubject "This is where the subject goes" | Select Sender,{$_.Recipients},{$_.RecipientStatus},MessageSubject,TimeStamp, EventId, Source, SourceContext,MessageId,InternalMessageId,ClientIP,ClientHostName,ServerIP,ServerHostName,ConnectorId,TotalBytes,RecipientCount,RelatedRecipientAddress,Reference,ReturnPath,MessageInfo | Export-Csv .\MessageTrackingLog.csv 

Last updated  June 13th, 2013 by Steven Jordan.




0 Comments:

Post a Comment

My Instagram