Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This article runs through the process of deploying a single EXE application selectively to a group of user.
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 to another domain controller. Log onto the new domain controller with a user account t…
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…

809 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