I'm looking to get a list of all Distribution Lists in Exchange along with their members? Is this possible using any built-in Exchange tools? Powershell? Third party tools?


Distribution groups are stored in Active Directory. This Powershell script will list all the distribution groups in the AD domain and their members. If you atually have them stored as security groups, remove "(|(groupType=2)(groupType=4)(groupType=8))".

$strFilter = "(&(objectCategory=Group)(|(groupType=2)(groupType=4)(groupType=8)))"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = "Subtree"
$objSearcher.PropertiesToLoad.Add("cn") | Out-Null
$objSearcher.PropertiesToLoad.Add("member") | Out-Null

$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults){
    $objItem = $objResult.Properties;
    Write-Output $objItem.cn
    foreach ($objMember in $objItem.member) {
        Write-Output "   $objMember"
  • 1
    I made one small change to output the Distribution List on the same line as the user: foreach ($objResult in $colResults){ $objItem = $objResult.Properties; foreach ($objMember in $objItem.member) { Write-Output "$($objItem.cn),$($objMember)" } } – Rob Burke Jul 13 '10 at 15:53

Or if you'd rather use the Powershell that comes with Exchange, here is an alternate script. It'll

 # dump all DLs to a variable, whether DistributionList or mail-enabled Sec-group
 $DLList = get-distributiongroup
 # Iterate over each DL to get member-list
 foreach ($DL in $DLList) {
     # Get the member list
     $Dmember=get-distributiongroupmember $DL
     # Get DL name
     # Start outputting
     write-output "`q$Dname`q" -nonewline
     # Iterate over member list, outputting
     foreach ($Member in $Dmember) {
         write-output ",`q$MName`q" -nonewline
     # Add terminal line-feed
     write-output "`n"

This should produce output that looks like:

 "Accounting","Mary Joe","Fred Smith"
 "Receiving Office"
 "Office, home","John Birtram"

Adust however you need to.

This script came largely off the top of my head and probably contains bugs.


I've accepted Torai's answer as it was the one I used but I made a small change in the foreach look to have it output the Distribution List on the same line as the User data:

foreach ($objResult in $colResults){
    $objItem = $objResult.Properties;
    foreach ($objMember in $objItem.member) {
        Write-Output "$($objItem.cn),$($objMember)"

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.