Jump to content

Recommended Posts

Posted

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

Posted (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 by ascott2
Typo
  • Thanks 1
Posted
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.

  • Thanks 1
Posted

Thankyou both,

 

The script I used for anyone else benefit is

 

Get-Mailbox -ResultSize Unlimited | Select PrimarySMTPAddress | Export-Csv FILEPATH.csv -NoTypeInformation

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...