Incoming mail for a specific time period

Is there a powershell command to give me either a report or list of email RECEIVED to my mailbox between specific dates and times:

Say I wanted to see ALL my email received in my in individual mailbox from: 2-23-2005 at 6:00 AM to 2-24-2005 12:00 PMAll I can find is criteria that gives me mail from or to a specific person.

Ant help would be appreciated.

RJM

February 24th, 2015 3:20pm

You can search the message tracking logs:

https://technet.microsoft.com/en-us/library/bb124926%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396
https://technet.microsoft.com/en-us/library/aa997573%28v=exchg.150%29.aspx
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2015 4:44pm

Assuming the items are in the inbox there is this:

New-MailboxExportRequest -Mailbox MyMailbox -IncludeFolders "#Inbox#" -ContentFilter {(Received -ge '02/23/2005 00:06:00') -and (Received -lt '02/24/2005 12:00:00')} -FilePath "\\server\C$\PST-Exports\exported.pst"

That one above won't remove the items from the mailbox, it just dumps a copy out into a PST.

I have had trouble with this one below trying to get it down to the minute but you can get a report sent to another mailbox with this:

Search-Mailbox -Identity MyMailbox -TargetMailbox SomeMailbox -TargetFolder test -SearchQuery '(Received:02/23/2005..02/24/2005)' -LogOnly -LogLevel Full

That search-mailbox one goes by UTC time for some reason so it misses some hours based on how far off from UTC you are and as I mentioned I haven't been able to get it to work entering the time, just the date.


  • Edited by MnM Show 12 hours 41 minutes ago
February 24th, 2015 6:12pm

Assuming the items are in the inbox there is this:

New-MailboxExportRequest -Mailbox MyMailbox -IncludeFolders "#Inbox#" -ContentFilter {(Received -ge '02/23/2005 00:06:00') -and (Received -lt '02/24/2005 12:00:00')} -FilePath "\\server\C$\PST-Exports\exported.pst"

That one above won't remove the items from the mailbox, it just dumps a copy out into a PST.

I have had trouble with this one below trying to get it down to the minute but you can get a report sent to another mailbox with this:

Search-Mailbox -Identity MyMailbox -TargetMailbox SomeMailbox -TargetFolder test -SearchQuery '(Received:02/23/2005..02/24/2005)' -LogOnly -LogLevel Full

That search-mailbox one goes by UTC time for some reason so it misses some hours based on how far off from UTC you are and as I mentioned I haven't been able to get it to work entering the time, just the date.



These commands look at what email you have now.  If you deleted an email, it will not show up.  The message tracking logs will show you every email you received/sent.
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 1:55am

Agreed with the above suggestions.

You may get such reports using Message-tracking logs.

Here is an informative resource that helps to calculate hourly email traffic using message tracking logs : http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser/

Moreover, if you wish to collect these reports more accurately into real time, You may also consider on Lepide exchange reporter that helps to get precise reports on the mailbox traffic of the entire network with the details such as, all emails sent and received within a particular duration, emails sent outside and inside organization, interaction between users in a particular duration etc.

February 25th, 2015 2:19am

Hi,

You can try this command, if these messages still stored on Exchange Server then it should work.

Get-MessageTrackingLog -recipients "Your SMTP Address" -Start "2/23/2005 6:00AM" -End "2/24/2005 5:00PM" | where-object {$_.EventID -eq "Receive"}

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 4:49am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics