Davit2005 Posted July 24, 2014 Posted July 24, 2014 I am trying to export a CSV from Office365 of just primary email address ( i.e. the one that should be the reply adddress ) I have PowerShell command that exports email addresses but this does not tell me the primary address i.e. the first email address is not necessarily the primary address as I found checking one user. Anyone know a specific switch to give me just the primary email address. Thanks
ascott2 Posted July 24, 2014 Posted July 24, 2014 (edited) I'm not entirely sure that O365 is the same as on premise exchange but in Exchange it's just Get-Mailbox | Select PrimarySMTPAddress Edited July 24, 2014 by ascott2 Typo 1
EduTech Posted July 24, 2014 Posted July 24, 2014 I am trying to export a CSV from Office365 of just primary email address ( i.e. the one that should be the reply adddress ) I have PowerShell command that exports email addresses but this does not tell me the primary address i.e. the first email address is not necessarily the primary address as I found checking one user. Anyone know a specific switch to give me just the primary email address. Thanks Hi, If you want to do this using the Exchange Module, Then you can use the following command: Get-Mailbox | fl DisplayName, PrimarySMTPAddress or if you want grid view Get-Mailbox | Select DisplayName, PrimarySMTPAddress | Out-GridView or, if you want to use the MSOL Commands: Get-MSOLUser | Select -Expand Proxyaddresses | ? {$_ -cmatch '^SMTP\:.*'} I hope that helps, James. 1
Davit2005 Posted July 24, 2014 Author Posted July 24, 2014 Thankyou both, The script I used for anyone else benefit is Get-Mailbox -ResultSize Unlimited | Select PrimarySMTPAddress | Export-Csv FILEPATH.csv -NoTypeInformation
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now