on-internet
← Community

Export Distribution Groups, Members and Email Addresses

Stack Overflow ·

I'm trying to get this command to list all distribution groups to include all email addresses (not just primary) and this works, although I'd like it comma delimited instead of space delimited if possible. The only thing that's missing are the Members which I'd also like to include the in the results. Can someone tell me how to do that? Get-DistributionGroup -Resultsize unlimited | Select Name,PrimarySmtpAddress, @{L="EmailAddresses";E={$_.EmailAddresses | ? {$_.PrefixString -ceq "smtp"} | % {$_.SmtpAddress}}} | Export-Csv c:\Results.csv -NoTypeInformation Essentially I should have the require

Comments

Sign in or sign up to comment and upvote.

No comments yet.