The following command will provide a list of all users primary smtp addresses.
Get-Mailbox -ResultSize Unlimited |Select-Object PrimarySmtpAddress > c:\primarysmtp.txt
-ResultSize Unlimited will remove any limitations on how many users are reported on. By default it will only display 1000 users unless this command is added
The output will look like the following:
You can expand the output results by adding additional values after “select-object” such as:
Get-Mailbox -ResultSize Unlimited |Select-Object Displayname, Alias, PrimarySmtpAddress > c:\primarysmtp.txt