Over the years, you end up creating a large number of
Distribution Groups based on user demands. The regular departmental Distribution Groups such as Sales, Marketing, Engineering, and HR. The geographical ones such as AllUS, All-California, All-BayArea, and so on. The ones by employment status such as All-FTE for full-time employees, All-Contractors, and so on. And ones to
facilitate the working habits of executives and senior managers, who want to address their team with a distro
(geekspeak for Distribution Group) like JoeSchmoe-DirectReports. Then there are the more interesting ones, such as All-MountainClimbers, All-GrungeFans.
Why are so many of these Distribution Groups prefixed with an
All-? Can Distribution Groups ever be All-
Whatever? Is it possible to include all grunge fans in the All-GrungeFans group? Or only the ones who confess? Can you guarantee everyone in the Sales dept will be included in the All-Sales group by default— even if you used Dynamic Distribution Groups? There will be times when someone does not populate the department attribute for the newly hired Manager of Inside Sales for Timbuktu, and surrounding areas. After two weeks in his exciting new inside sales position, the poor bloke finds out he hasn't received the number of sales leads freely flying around on the distro, and unfortunately won't be able to meet his targets for selling surfboards in Timbuktu that quarter.
Over the lifetime of Exchange deployments, there will be groups that get used more frequently, such as
Send-Your-Jokes-Here-If-You-Have-Nothing-Better-To-Do-At-Work (the alias conveniently shortened to ExecTalk... ), or the ones that never get used, such as
All-ExEmployees .
One fine day, your friendly manager/auditor/HR person shows up at your desk wanting to know which distribution groups are in use.
That's where message tracking logs come to the rescue— assuming these are enabled. If you've been mucking around with these logs in Exchange 2007, you probably know a fair bit of PowerShell, and chances are you're absolutely loving it! If not, head over to previous post
Exchange Server 2007: Message Tracking from the command line, and get to know the wonderful cmdlet
Get-MessageTrackingLog.
Tracking messages sent to Distribution GroupsHow do we get a list of messages sent to Distribution Groups? By getting a list of all Distribution Group expansion events, noted in message tracking logs with the
EventID EXPAND. The
RelatedRecipientAddress field in the
EXPAND entry contains the
PrimarySmtpAddress of the Distribution Group expanded. Use the following command to grab a list. You can restrain
Get-MessageTrackingLog cmdlet in a number of ways. Since these have been covered in the previous post, I won't go into details here.
Get-MessageTrackingLog -Start 2/1/2009 -EventID Expand | ft Timestamp,RelatedRecipientAddress -Autosize
You get back a table that looks something like this:
Timestamp RelatedRecipientAddress
--------- -----------------------
2/18/2009 4:36:27 PM DG-Marketing@MyDomain.com
2/18/2009 4:41:18 PM DG-Sales@MyDomain.com
Next, how do we determine how many messages each Distribution Group received? This is easily done by piping the results to the
Group-Object cmdlet:
Get-MessageTrackingLog -Start 2/1/2009 -EventId Expand | group-object RelatedRecipientAddress | ft Name,Count -Autosize
This returns a count for each group of messages:
Name Count
---- -----
DG-Marketing@MyDomain.com 123
DeptSales@MyDomain.com 145
To list messages sent to a particular Distribution Group:
Get-MessageTrackingLog -EventID Expand | ? {$_.RelatedRecipientAddress -like "DG-Marketing@MyDomain.com"} | ft Timestamp,Sender,MessageSubject -Autosize
Of course, you could use the message tracking GUI in
EMC— but would it rate anywhere close on your
geek satisfaction index?
Labels: Administration, Exchange Server 2007, Exchange Shell, SMTP