Get The Members Of An Exchange 2007 Distribution Group…

Many a times we are faced with the task of getting all the members in a distribution group, especially in a large group. It is very easy with Powershell. Run the following command,

Get-DistributionGroupMember –identity “group name”

In order to select the properties we need, pipe the command to format-table with the necessary values.

Get-DistributionGroupMember –identity “group name” | ft name, primarysmtpaddress

1

As usual, we can export the output to a txt or csv file.

Get-DistributionGroupMember –identity “group name” | ft name, primarysmtpaddress | Export-CSV c:members.csv

9 Responses to “Get The Members Of An Exchange 2007 Distribution Group…”

  1. Anonymous October 12, 2009 at 12:50 am #

    Very helpful ,Thanks Liam

    [Reply]

  2. Rajith Jose Enchiparambil October 13, 2009 at 10:48 am #

    Thanks Liam.

    [Reply]

  3. selvan October 28, 2009 at 3:07 pm #

    Hey !

    I have a distribution list which contains other distribution groups. Is there any way to list all the members who is member of the main group?

    example:
    Got a group called A, and this group is has members B and C. B and C contains users.
    I need to get a list of alle the members who indirectly is member of the main group A.

    Thanks.

    [Reply]

  4. Rajith Jose Enchiparambil October 28, 2009 at 4:03 pm #

    Easiest will be to install PowerGUI, a free GUI to manage AD, Exchange, VMWare etc and run Get-QADGroupMember "group name" -Indirect from the script editor or load the quest snapin in powershell and run it from there.

    http://www.powergui.org

    [Reply]

  5. Anonymous November 26, 2009 at 3:56 pm #

    For the problem Selvian posted, in detail (i.e.) I downloaded ActiveRoles Management Shell for Active Directory 32-bit in my windows xp from http://www.quest.com/powershell/activeroles-server.aspx
    and then from Desktop ProgramsQuestSoftwareActiveR… lauch the shell. Otherwise you can use it from PowerGUI (getting it from FilesPowershell libraries)

    Leo

    [Reply]

  6. Rajith Jose Enchiparambil November 26, 2009 at 4:09 pm #

    Thanks for the explained post Anonymous.

    [Reply]

  7. yash November 25, 2010 at 8:23 am #

    can i get output as count of members for each distribution group of my exchange 2007 from one command

    [Reply]

  8. Anonymous May 18, 2011 at 11:47 pm #

    You cannot pipe from a format-table into an Export-Csv.

    You have to use Get-DistributionGroupMember –identity “group name” | Select-Object name, primarysmtpaddress | Export-CSV c:members.csv

    See http://blogs.msdn.com/b/powershell/archive/2007/03/07/why-can-t-i-pipe-format-table-to-export-csv-and-get-something-useful.aspx

    [Reply]

  9. Rajith Jose Enchiparambil May 19, 2011 at 10:25 am #

    Thanks

    [Reply]

Leave a Reply:

Gravatar Image