Count incoming/outgoing messages
Exchange 2k7 on Windows 2k3. Is there a way to count the number of messages going through my exchange server without the use of a 3rd party app? I was thinking is has to be possible with a VB or powershell script but ensure where to start.
November 23rd, 2010 6:11am

I'd use Powershell, and get the information from the message tracking logs. I run a script every day as a scheduled task that accumulates message count and size states from the previous days logs and creates a .csv, and at the end of the month tallys them up and creates a report for management. You can get status on just the number of messages sent and received by counting the Deliver and Received events in the logs.[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 6:25am

Hi, You can use log parser to analyse and interpret the Exchange message tracking Log files to find the total number of emails sent / received. For more information on log parser follow the link below. http://www.msexchange.org/tutorials/Using-Logparser-Utility-Analyze-ExchangeIIS-Logs.html also there are some paid softwares like Permessa Email Control, Mailscape, netwrix etc.Dinesh
November 23rd, 2010 7:24am

I'd use Powershell, and get the information from the message tracking logs. I run a script every day as a scheduled task that accumulates message count and size states from the previous days logs and creates a .csv, and at the end of the month tallys them up and creates a report for management. You can get status on just the number of messages sent and received by counting the Deliver and Received events in the logs. [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " mjolinor: Any chance you can post the contents of your script?
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 7:50am

Try this one in powershell on your hub transport server: get-messagetrackinglog -start “mm/dd/yyyy hh:mm:ss” -end “mm/dd/yyyy hh:mm:ss” -eventid “send” -resultsize 9999999 | measure-object This will pull stats for messages that were “sent”. To pull the number of messages received, change the “eventid” parameter to “receive.”Dinesh
November 23rd, 2010 8:05am

Any chance you can post the contents of your script? I can give you an example for what you're wanting to do. Mine is considerably more complicated, and is accumulating stats per user, broken out by total and unique messages and bytes sent (one 1MB email to 5 recipients is 5 total messages and 5MB total bytes, but 1 unique message and 1MB unique bytes), and that broken down by internal and external messages, and received messages are broken down by external, internal, and internal automated (SCOM alerts, etc), so there is a lot of logic involving checking the source IP that won't translate very well to someone else's systems. Briefly: $hts = "hub_server1","hub_server2","hub_server3" $start = (get-date).adddays(-1).toshortdatestring() $end = (get-date).toshortdatestring() $logs = $hts |% {get-messagetrackinglog -start $start -end $end -server $_ -resultsize unlimited} $stats = ""| select sent,received $logs |% { if ($_.eventid -eq "Deliver"){[int]$stats.sent += 1} if ($_.eventid -eq "Send"){[int]$stats.received += 1} } $stats | ft -auto [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 9:39am

Sorry, there's a typo there, and the sent and received will be switched. $hts = "hub_server1","hub_server2","hub_server3" $start = (get-date).adddays(-1).toshortdatestring() $end = (get-date).toshortdatestring() $logs = $hts |% {get-messagetrackinglog -start $start -end $end -server $_ -resultsize unlimited} $stats = ""| select sent,received $logs |% { if ($_.eventid -eq "Deliver"){[int]$stats.received += 1} if ($_.eventid -eq "Send"){[int]$stats.sent+= 1} } $stats | ft -auto[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
November 23rd, 2010 9:45am

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

Other recent topics Other recent topics