Last active
April 27, 2024 22:15
-
-
Save supermarsx/016482b24806d0ec6652df696005f534 to your computer and use it in GitHub Desktop.
Get Exchange Mailbox/DistributionGroup name, primary address and aliases to csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv email-addresses.csv | |
Get-DistributionGroup -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv group-addresses.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment