Monday 25 August 2014

Microsoft: Export Information of Distribution List Members from Microsoft Exchange

The Powershell script below allows you to export the information of the distribution list members from Microsoft Exchange:
$saveto = "C:\\listmembers.txt"
Get-DistributionGroup | sort name | ForEach-Object {
"`r`n$($_.Name)`r`n=============" | Add-Content $saveto
Get-DistributionGroupMember $_ | sort Name | ForEach-Object {
If($_.RecipientType -eq "UserMailbox")
{
$_.Name + " (" + $_.PrimarySMTPAddress + ")" | Add-Content $saveto
}
}
}

Reference:
Export Distribution List Members
http://community.spiceworks.com/scripts/show/1388-export-distribution-list-members

No comments:

Post a Comment