Task – Listing Members Of An Exchange 2007 Dynamic Distribution Group…

As exchange admins, we might come across a scenario where we need a list of all users in a dynamic distribution group. Most companies will have an “All Staff” dynamic group filtering users based on a selected criteria ( users with mailboxes for example). Larger companies will have dymanic groups based on department, organizational unit…

As exchange admins, we might come across a scenario where we need a list of all users in a dynamic distribution group. Most companies will have an “All Staff” dynamic group filtering users based on a selected criteria ( users with mailboxes for example). Larger companies will have dymanic groups based on department, organizational unit etc.

Though it is easy to view the members of the group in exchange management console using the “preview” functionality, things become hard if you want a csv file which lists all the members, either for reporting or troubleshooting purposes.

With powershell, our life becomes easy. Let me explain with an example. I have a dynamic distribution group named “All Staff” and want to list the members of it in a text file. Run the following command to get the list in shell,

$group = Get-DynamicDistributionGroup –identity “AllStaff”

Get-Recipient –RecipientPreviewFilter $group.RecipientFilter

10

In order to export the result to a text file, run

$group = Get-DynamicDistributionGroup –identity “AllStaff”

Get-Recipient –RecipientPreviewFilter $group.RecipientFilter | Out-File c:allstaff.txt

11

3 Comments

  1. Mark Giemza says:

    Any particular reason you can think of as to why this command returns all User Mailboxes in my organization and not just the User Mailboxes in the group? Currently, when the group is selected in Microsoft Outlook the group will send an email to all members of one particular Organizational Unit.

  2. Thanks for the concise info… if only there were more useful searchable attributes.

    1. Rajith Enchiparambil says:

      Thanks Ed.

Leave a Reply

Your email address will not be published. Required fields are marked *