Determine database quota’s Exchange migratiion from Exchange Online Script

Hello everyone. I just finished working on a script of mine, which I just uploaded to Technet.

This script is useful when migrating Mailboxes back towards on-premises for various reasons. Exchange Databases can have quota’s assigned to them. When migrating back towards on-premises, these quota’s must be larger as the mailboxes being migrated back. Otherwise the migrations will fail. However it can be a tedious task to find out what quota’s apply and matching them against the mailboxes to find out if you can safely migrate back. This script has been defined, that first of all you have to enter your parameters which include:

  • Filepath to get your csv as input. (UPN of the user is used to match against)
  • Mailbox database name
  • Archive database name

In addition the following functions have been defined:

  • LoginCloud: Lets you connect to Office 365
  • get-maxmailboxes: Lets you query the mailboxes in your csv and mailbox databases for quota’s and returns the highest value
  • compare-mailbox: Compares values found by the get-maxmailboxes function. It then tells you wheter you should increase your quota’s or that you are safe to migrate.
  • logout: closes your pssessions


  • 10/10/2016 – added login functions for cloud & on-premises
  • 10/10/2016 – Updated login functions with prefix
  • 10/10/2016 – updated parameters section
  • 10/10/2016 – defined function get-maxmailboxsizes
  • 10/10/2016 – defined function compate-mailbox
  • 10/10/2016 – defined logout function
  • 10/10/2016 – disabled function of archive by default, because not all users have archives (request).

For Comments, feedback and support contact me!

You may also like...

Leave a Reply

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