Getting a list of distribution lists and their members in Exchange 2007

1149700 pts.
Tags:
Microsoft Exchange 2007
I'm trying to get a list of all Distribution lists in Microsoft Exchange, along with the members too. Would this be possible? Does anyone know of a third-party tool or should I use Powershell?  Thanks!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

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”

    }

}

Thanks & Regards

Clark Kent

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: