i am trying to export DL owners in smtp format. but the formatting seems to incorrect
These are the challenges facing
- some of the DLs have multiple owners
- export managed by field in smtp format
the code that i am using is
Get-DistributionGroup -ResultSize unlimited|?{$_.DisplayName -like "*user*"}| Select DisplayName, PrimarySmtpAddress,@{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}}, OrganizationalUnit, @{n="ManagedBy";e={(Get-Recipient $($_.ManagedBy)).PrimarySmtpAddress -join ","}}, LegacyExchangeDN, DistinguishedName|Export-Csv "DLs _$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv" -NoTypeInformation
