Thursday 2 February 2012

Message tracking report in Exchange 2010 - Error: "String was not recognized as a valid DateTime."

I ran a Microsoft.Exchange.2010.Reports.Transport.Platform.TopUsers on SCOM and found that a single user received 50k+ messages in a week. So I decided to get more details from Exchange server.

I played a bit with Toolbox > Mail Flow Tools > Tracking Log Explorer, but could not get what I needed. Then I tried Exchange Management Shell:

[PS] C:\Windows\system32>get-messagetrackinglog -Recipients:user@domain.com -Server "HT_server" -Start "26/01/2012 9:28:00 AM" –End "3/02/2012 9:38:00 AM" | Export-Csv c:\username.csv

But I got an error saying:
Cannot process argument transformation on parameter 'Start'. Cannot convert value "26/01/2012 9:28:00 AM" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
+ CategoryInfo : InvalidData: (:) [Get-MessageTrackingLog], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MessageTrackingLog


I found in an HP article that the date format has to be English US, even though the regional settings on the server are set to something else, e.g. English Australia. So this time it worked:

[PS] C:\Windows\system32>get-messagetrackinglog -Recipients:user@domain.com -Server "HT_server" -Start "1/26/2012 9:28:00 AM" -End "2/3/2012 9:38:00 AM" | Export-Csv c:\username.csv

But then I got a warning saying:

WARNING: There are more results available than are currently displayed. To view them, increase the value of the ResultSize parameter.

The output file contained only data processed during several hours of the first day of the specified week. Then I included the parameter -ResultSize unlimited and finally got what I needed.

[PS] C:\Windows\system32>get-messagetrackinglog -Recipients:user@domain.com -Server "HT_server" -Start "1/26/2012 9:28:00 AM" -End "2/3/2012 9:38:00 AM" -ResultSize unlimited | Export-Csv c:\username.csv


Microsoft Exchange Server 2010 - Get-MessageTackingLog cmdlet Returns Error or Unexpected Results if DateTime Parameter Is Not in en-US format

No comments:

Post a Comment