Solved

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

Posted on 2012-03-19
3
530 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 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

734 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