April 24, 2013

Exchange 2010 - PowerShell - Get-DistributionGroupMember

Getting Distribution Group members with source distribution name included:

$DLS = foreach ($GROUP in (Get-DistributionGroup -Filter {name -like "*"})) {Get-DistributionGroupMember $GROUP | Select @{Label="Group";Expression={$GROUP.Name}},@{Label="User";Expression={$_.Name}},SamAccountName,RecipientType}

$DLS | Sort Group,User

No comments:

Post a Comment