How to display user's email addresses and alias's Exchange 2010

Is there a way to generate a list of all domain users with email addresses and have the list display their alias addresses also?

And while I'm asking, is there a way to also display all the users that have forwarding on their accounts and who the forwarding email is going to?
Who is Participating?
pijiConnect With a Mentor Commented:
You can run below script for users email addresses:

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

In Exchange 2010 and Exchange 2007, you can easily list this information using the shell:

Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize

The ForwardingAddress is output as the Active Directory object (john smith\contacts\someguy) instead of the SMTP address. The following command can output the PrimarySMTPAddress of the recipient:

Get-Mailbox -Filter {ForwardingAddress -ne
$null} | foreach {$recipient = $_; $forwardingsmtp = (Get-Recipient $_.ForwardingAddress).PrimarySmtpAddress; Write-Host $recipient.Name, $forwardingsmtp, $recipient.DeliverToMailboxAndForward }
johnny181Author Commented:
those did the trick!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.