How to find and export all Exchange users andthe size of their mailbox
Report – FIND ALL USERS MAILBOXES AND THE SIZE OF THEIR MAILBOX
First of all we are going to use Exchange Management Shell. So please locate Exchange Shell from start and run it as admin. If you are ready then proceed to the next step !
Tip! Do not trust every powershell script that you find online. See the ones with the Get commands. Get commands are only reading informations so there is no worry to brake something.
The command we are going to use is the Get-MailboxDatabase. Please make sure to copy the command and change the path where you save the outout file.
Get-MailboxDatabase | Get-MailboxStatistics | Select DisplayName, PrimarySmtpAddress, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV "C:\temp\UserList.csv" -Encoding UTF8
This is going to return you a full user list of your onpremises users’ mailbox. Please note that i work in Greece so -Encoding UTF8 is Mandatory for displaying Greek Characters.