Saturday, 30 April 2016

Listing all Exchange SMTP email addresses and aliases

Exports a list of Display names, Primary email address and any aliases and outputs them to a file on the C:\

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\exported-smtp-addresses.csv -NoTypeInformation

No comments:

Post a Comment