Jul 01 2019 01:13 AM - edited Jul 01 2019 01:19 AM
what is the powershell script to export display name and primary smtp address of all users?
thanks
Jul 01 2019 01:21 AM
Jul 01 2019 02:25 AM - edited Jul 01 2019 02:27 AM
You can run below code to export all office 365 mailboxes' DisplayName and PrimarySMTPAddress to CSV file.
Get-Mailbox -Resultsize Unlimited | select DisplayName,PrimarySMTPAddress | Export-csv E:\O365Users.csv -NoType -Append
If you need additional attributes like license details, mfa status and mailbox permissions, you can refer this blog: Export Office 365 user details report