skip to Main Content

Get mailbox size of all users in Exchange with PowerShell

We want to get the mailbox size of all users in Exchange with PowerShell. Why do we need to list the mailbox size for all users? For example, you want to migrate the users to a new Exchange Server. Before doing that, find all the users’ mailbox size in Exchange. What if you need more information regarding the mailbox. What kind of information do you need in particular? The script that we are going to use in this article will gather 22 types of information per mailbox.

Information mailbox size of all users PowerShell script

The script will run and find all users with a mailbox including the size. It does have more than one option. The one that we are interested in is to export a list to CSV. The following information per mailbox will be gathered in the CSV file:

  1. Display Name
  2. Alias
  3. SamAccountName
  4. RecipientType
  5. Recipient OU
  6. Primary SMTP address
  7. Email Addresses
  8. Database
  9. ServerName
  10. TotalItemSize
  11. ItemCount
  12. DeletedItemCount
  13. TotalDeletedItemSize
  14. ProhibitSendReceiveQuota-In-MB
  15. UseDatabaseQuotaDefaults
  16. LastLogonTime
  17. ArchiveName
  18. ArchiveStatus
  19. ArchiveState
  20. ArchiveQuota
  21. ArchiveTotalItemSize
  22. ArchiveTotalItemCount

Get mailbox size of all users with PowerShell script

Let’s configure the script and see it in action. Download the following PowerShell script from here (Microsoft) or here (direct link). Save it on your Exchange Server in the following path: C:\scripts\. This script is made by MVP Satheshwaran Manoharan.

Get mailbox size of all users in Exchange with PowerShell scripts folder

Run Exchange Management Shell as administrator. Run the following commands to change the directory path and start the script. The Mailbox Size Report script will be displayed.

The script got 7 options. The one that we are looking for is option 2. Export to CSV File.

Insert 2 and press Enter.

The Mailbox Size Report PowerShell script will ask for a path. The export of the CSV file will get exported to that path.

Insert the following path: C:\scripts\report.csv and press Enter.

The Mailbox Size Report PowerShell script starts scanning the mailboxes in the organization. This can take some time. When done, a list is created and exported in a CSV file. You can exit the script.

Result mailbox size of all users in Exchange

Let’s have a look if the script made the export successful by going to the following path: C:\scripts\. You should see the report.csv file.

Get mailbox size of all users in Exchange with PowerShell exported CSV in folder

Open report.csv with your favorite application, for example with Microsoft Excel. If you don’t need all the information, you can remove those columns. You can sort the file by Display Name, TotalItemSize or by any other type. Tweak the information to your needs.

Get mailbox size of all users in Exchange with PowerShell csv report

Conclusion

In this article, you did learn how to get the mailbox size of all users in Exchange with PowerShell. It’s a great script to list the mailbox size for all users in the organization. You should use it more often to get the mailbox size and extra information. If you enjoyed this article, you may also like Not digitally signed error when running PowerShell script. Don’t forget to follow us.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Connect with ALI TAJRAN on social media. Read more »

This Post Has 2 Comments

  1. Hello, Ali.
    Thank you for this script.
    I’d like to understand why did you use the BigFunnelMessageCount instead of the ItemCount when counting archive messages?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top