Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\smtp.csv -NoTypeInformation
I have wrapped it here so just paste it in to Power Shell to run and this will show the Primary Email address and then all the alias addresses.
Thanks to Karl Mitschke for this information!
Thank you it worked great!
ReplyDeleteThank you very much, it is helping my work easier.
ReplyDeleteSuperb !
ReplyDeletePerfect, just what I needed.
ReplyDeleteAmazing.
ReplyDeleteCopied and pasted and the command into the shell and it created the smtp.csv file in the root directory on the C drive on my exchange server.
Thank you very much!
This was very helpful, thank you!
ReplyDeleteThanks very much for sharing!
ReplyDeletehow would you add mailbox size to this script?
ReplyDelete(BTW this is awesome, thanks for this!!)
Excellent! I changed the beginning to get-mailcontact and got the clean export I had been looking for. Thank you!
ReplyDeleteThanks mate good info.
ReplyDeleteVery helpful and saved me hours. Thanks for sharing.
ReplyDeletethanks bra
ReplyDeleteGet-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -contains “smtp”} | ForEach-Object {$_.SmtpAddress}}} is the proper context for Exchange 2010 and above
ReplyDeletemany thanks amigo, very useful
ReplyDeleteThanks for this! Nice to have a command like this that works first time.
ReplyDeleteGreat! It's worked well
Deletecheers bra
ReplyDeletegreat
ReplyDeletethis is excellent. Saved me a lot of time/effort. Thanks.
ReplyDeleteIt works fine, thanks !
ReplyDeleteIt works fine, thanks !
ReplyDeletegood, it helped me
ReplyDeleteomG, thank you very much
ReplyDelete