digitalco
asked on
Get-messagetracking log and date format
So we have Exchange Hub Transport servers in US and Europe. One of the tasks we sometimes need to carry out is searching the Message Tracking log for users sending and receiving messages and so on.
We often have to search all Hubs globally.
http://technet.microsoft.com/en-us/library/aa997573(EXCHG.80).aspx
The below is an example:
Get-TransportServer | Get-messagetrackinglog -sender user1@domain.com -recipients user2@domain.com
It would be useful to add the -Start or -End dates to the search, but how does this work if we are searching between Hubs that use a different date format?
For example, if I wanted to search for messages from user1 to user2 after April 16th 2011, then this causes a problem. The US servers would have this as 4/16/2011 however the Europe servers would have this as 16/4/2011. If I check servers Regional Settings, then we can see that they use different date formats.
What do we need to do?
We often have to search all Hubs globally.
http://technet.microsoft.com/en-us/library/aa997573(EXCHG.80).aspx
The below is an example:
Get-TransportServer | Get-messagetrackinglog -sender user1@domain.com -recipients user2@domain.com
It would be useful to add the -Start or -End dates to the search, but how does this work if we are searching between Hubs that use a different date format?
For example, if I wanted to search for messages from user1 to user2 after April 16th 2011, then this causes a problem. The US servers would have this as 4/16/2011 however the Europe servers would have this as 16/4/2011. If I check servers Regional Settings, then we can see that they use different date formats.
What do we need to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
So you're saying that even if we're searching ALL global Hubs, we should use the format of the server we're running the command from?
So you're saying that even if we're searching ALL global Hubs, we should use the format of the server we're running the command from?
Exactly.
If all is well in the Microsoft world... the server you are running it against will convert it from your regional settings to UTC (universal) format anyway, in code.
If all is well in the Microsoft world... the server you are running it against will convert it from your regional settings to UTC (universal) format anyway, in code.
If you supply 7pm...and you are in Germany...
That time is 1pm in the US EST, on the same day, and that is going to be the time it's is searching.
That time is 1pm in the US EST, on the same day, and that is going to be the time it's is searching.
This is why when you send a calendar invite to someone cross country, if everything is setup correctly.. the time is converted to match so that you actually meet when you are supposed to.
Same concept applies to e-mail...
Same concept applies to e-mail...
Oh yea...
If you supply ... 4/29/2011 - 4/30/2011 ...that encompasses 4/28/2011 6:00pm - 4/29/2011 5:59pm EST in the US if you are running it against a server in Germany.
This is a core function of windows, ...regional settings. Things would be very confusing for all programmers without this consideration.
If you supply ... 4/29/2011 - 4/30/2011 ...that encompasses 4/28/2011 6:00pm - 4/29/2011 5:59pm EST in the US if you are running it against a server in Germany.
This is a core function of windows, ...regional settings. Things would be very confusing for all programmers without this consideration.
I can't imagine MS would make such a novice mistake in their cmdlet or exchange for that matter.