Search-mailbox in Exchang 2016 server

DP230
DP230 used Ask the Experts™
on
Dear Experts, is there anyway to search exchange mailbox with exact time range?

For example I 'd like to search an email with ketwork "abc" in content and was received before 2.45pm of 26 Dec 2019?

I tried Search-mailbox command on Exchange 2016 but it did not work
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
FOXActive Directory/Exchange Engineer
Top Expert 2015
Commented:
1.  Check the way your date and  time is formatted in your environment for your command.  
Open Exchange Management shell and run the following command:

Search-Mailbox -ResultSize Unlimited -SearchQuery {body:"abc"' AND received="12/26/2019 12:00 AM..12/26/2019 2:45 PM"}
DP230Network Administrator

Author

Commented:
I tried to follow your instructions but it did not help, even when I specified the exact time of receiving email

It only succeed when I removed the time as you can see here

Capture.JPG
Any idea pls?
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
If you supply the time, you probably have to use the exact one  - down to the second -  or you should use a time range instead.
DP230Network Administrator

Author

Commented:
Yes I used time range but did not work. Can you take screenshot of your testing?
FOXActive Directory/Exchange Engineer
Top Expert 2015

Commented:
DP
1. run the command Get-Date to verify if your time on the machine is using 12 hour or a 24 hour clock so that your command will be correct
2. Reference this link below with Carloslaan's command and your correct time format and try to pull your information.
https://markgossa.blogspot.com/2015/11/search-mailbox-with-date-range-and-time.html?_sm_au_=iVV7DDQJF76fDJTTkRvMGK3JRp2ft
Network Administrator
Commented:
ok, I got it. It because of time zone, Exchange is not GMT+0 whereas we are in GMT+7.

After changed the query to correct time which is matched with GMT+0, the command worked perfectly.

Many thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial