Link to home
Start Free TrialLog in
Avatar of Anonymous KH
Anonymous KHFlag for Singapore

asked on

How to export all the email addresses of an organisation?

Dear Experts,

I tried to export out my customer's address list from the office365 ecp but it just shows the user's email addresses only.

How about those in the distribution group or if a user has access to more than one email accounts?
Avatar of Afthab T
Afthab T
Flag of United Arab Emirates image

ASKER CERTIFIED SOLUTION
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anonymous KH

ASKER

A positional parameter cannot be found that accepts argument 'EmailAddresses'.
   + CategoryInfo          : InvalidArgument: (:) [Get-Mailbox], ParameterBindingException
   + FullyQualifiedErrorId : PositionalParameterNotFound,Get-Mailbox

This means what?
I saw that EmailAddresses can be used in the cmdlet
Please, use this one:

get-mailbox -filter *  | select Name,EmailAddresses  | Export-csv D:\All_emails.csv -NoTypeInformation
Get-UnifiedGroup | select Name,@{L="EmailAddresses"; E={$_.EmailAddresses -join ","}}  | Convertto-csv -notypeinformation | select-object -skip 1 | out-file D:\All_emails.csv -append

Open in new window


PS: Yes it can be used in the cmdlet directly
If you want to generate a list of all the addresses in your tenant, use this script: https://gallery.technet.microsoft.com/office/Office-365-aliases-b3937767
Hi! Jose,

I managed to get the list.

I changed the command from Get-Mailbox to Get-DistributionGroup and it works.
Thanks Experts!
Glad it worked, try Vasil's as well :)
I think his script is way more elaborate than mine :)