Solved

Exchange 2007: Export a list of all distribution lists and their members

Posted on 2012-03-19
3
523 Views
Last Modified: 2012-03-20
I would like to export a list of all distribution lists and their members using powershell. What would be the method for doing so?
0
Comment
Question by:vitalsign0
3 Comments
 
LVL 4

Expert Comment

by:ITF1
ID: 37740026
Hi,
please use:
Get-DistributionGroup | Get-DistributionGroupMember | Export-CSV C:\Members.csv
This gives you all information into a .csv.

Regards

ITF1 | Anthony
0
 
LVL 18

Accepted Solution

by:
suriyaehnop earned 400 total points
ID: 37740916
Hi,

This one I recently created.

$Groups = Get-DistributionGroup -ResultSize Unlimited


$Result = Foreach ($Group in $Groups){

$DL=Get-DistributionGroup -Identity $Group.alias
$DL | FT Displayname,PrimarySMTPAddress


Get-DistributionGroupMember -Identity $DL | where {($_.RecipientType -eq 'UserMailbox') `
-or ($_.RecipientType -eq 'MailUniversalDistributionGroup') -or ($_.RecipientType -eq 'MailContact')} | FT displayname,primarysmtpaddress

} 

$Result | Out-File C:\Users\DLResult3.csv

Open in new window


Thie output will be CSV in following format:

Distribution
Displayname   PrimarySMTPAddress
All_Users          all_users@contoso.com

Displayname   PrimarySMTPAddress
Member01      .....
.............
0
 
LVL 1

Author Closing Comment

by:vitalsign0
ID: 37744546
This worked. Thank you.
0

Featured Post

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
how to add IIS SMTP to handle application/Scanner relays into office 365.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now