Forum Discussion
rootwontfall
Jun 08, 2019Copper Contributor
Script to export to CSV all Mailboxes and SharedMailboxes
Hi, I'm trying to make a new script in Powershell to display (for a report) the following attributes in a CSV table like this: DisplayName UserPrincipalName Licenses RecipientTypeDetails ...
kathy
Jun 10, 2019Brass Contributor
You can try https://o365reports.com/2019/03/07/export-office-365-users-last-logon-time-csv/ script that will report needed attributes(DisplayName, UPN, Licenses, RecipientTypeDetails). You need to add TotalItemSize alone. To get TotalItemSize, add below line in 110th line of script.
$TotalItemSize=(Get-MailboxStatistics -Identity $upn).TotalItemSize.
Additionally,
- This script shows 'Friendly Name of Licenses. For eg, ‘Office 365 Enterprise E3’ rather than ‘ENTERPRISEPACK’.
- Result can be filtered based on user / all mailbox type.
- The script can be executed with MFA enabled account.