List all recepients in all Distribution Lists in Office365 / Exchange in powershell
List all recipients in all Distribution Lists in Office365 / Exchange in powershell
- To the screen:
foreach ($group in Get-DistributionGroup) { get-distributiongroupmember $group.Identity | sort displayname | ft @{expression={$_.displayname};Label="$group"}, @{expression={$_.PrimarySmtpAddress};Label="Emailadres"}
- To a File
foreach ($group in Get-DistributionGroup) { get-distributiongroupmember $group.Identity | sort displayname | ft @{expression={$_.displayname};Label="$group"}, @{expression={$_.PrimarySmtpAddress};Label="Emailadres"} | Out-File c:tempDistributionListMembers.txt -append}
Inspirations:
http://www.oxfordsbsguy.com/2014/04/21/exchange-powershell-how-to-enumerate-distribution-lists-managers-and-members/
https://social.technet.microsoft.com/forums/windowsserver/en-US/9a8f028c-db75-4659-8c70-984ab57ad5cc/get-list-of-distribution-groups-that-user-is-a-member-of
Comentários