Using Powershell to parse Transport log to calculate the number of Email from internal and external domain ?
Hi People, I need your help in modifying the below script to calculate the total email sent to a distribution group of what has originated outside of the organization as opposed to inside the organisation. Get-TransportServer | Get-MessageTrackingLog -resultsize unlimited -start "2011-07-25 00:01" -end "2011-08-8 23:59" -EventId Expand | Group-Object RelatedRecipientAddress | Select-Object Name, Count, @{n="totalMBs"; e={[int](($_.group | Measure-Object -Property totalbytes -Sum).sum/1mb)}} | Sort Name | Export-Csv C:\EmailStat.csv so the result would be something like this pretty much: Name : group1@domain.com Count : 12 totalMBs : 23 From Internal @domain.com : 10 From External : 2 Name : group2@domain.com Count : 56 totalMBs : 235 From Internal @domain.com : 48 From External : 8 Any help would be greatly appreciated. Thanks. /* Server Support Specialist */
August 10th, 2011 1:52am

Hi Albert, For this issue, please have a read for this document, this is a very good script: Exchange 2007/2010 Email stats http://gallery.technet.microsoft.com/scriptcenter/bb94b422-eb9e-4c53-a454-f7da6ddfb5d6?SRC=Home I will try to modify your script in my lab, and update the post when I get the result. Thanks, Evan Liu TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com
Free Windows Admin Tool Kit Click here and download it now
August 11th, 2011 3:13am

Yes, I have tried that too but it is too general, what I'd like to do is to get targetted result for distribution group only and separated by domain.com (internal) while the rest can be categorized as external./* Server Support Specialist */
August 11th, 2011 3:15am

Many thanks for the reply man, however does the EventID matters ? I'm confused in using EXPAND or RECEIVE to get the count for the distribution group./* Server Support Specialist */
Free Windows Admin Tool Kit Click here and download it now
August 15th, 2011 8:53pm

ah, OK now I see the difference. Many thanks once again for the explanation man./* Server Support Specialist */
August 15th, 2011 10:04pm

Hi Evan, I came across your code and it's exactly what I'm looking for. Although in my case, it doesn't seem to be enumerating the domain properly. All counts are 0 for internal, although I see a number for external. When I hard code a domain for $DomainName, it seems to work, but I am also getting incorrect counts. When I run get-AcceptedDomain |% {$_.domainname.domain}, it displays our 5 domains. As far as the incorrect count. Groups that haven't received anything still show as 1 external message. Are you available to assist? Thanks!
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2012 4:49pm

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

Other recent topics Other recent topics