Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-19
3
Medium Priority
?
533 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 19

Accepted Solution

by:
suriyaehnop earned 1600 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

704 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