Anonymous KH
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A positional parameter cannot be found that accepts argument 'EmailAddresses'.
+ CategoryInfo : InvalidArgument: (:) [Get-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun d,Get-Mail box
This means what?
+ CategoryInfo : InvalidArgument: (:) [Get-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun
This means what?
ASKER
I saw that EmailAddresses can be used in the cmdlet
Please, use this one:
PS: Yes it can be used in the cmdlet directly
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
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
ASKER
Hi! Jose,
I managed to get the list.
I changed the command from Get-Mailbox to Get-DistributionGroup and it works.
I managed to get the list.
I changed the command from Get-Mailbox to Get-DistributionGroup and it works.
ASKER
Thanks Experts!
Glad it worked, try Vasil's as well :)
I think his script is way more elaborate than mine :)
I think his script is way more elaborate than mine :)
https://www.experts-exchange.com/questions/29079611/Export-Office-365-Group-members-into-a-CSV-file-using-powershell.html