Mailbox Moving Day
You have spent days (or weeks) setting up your Office 365 infrastructure, and now the moment is finally here to move your mailboxes to the cloud. Hopefully, you have tested the mailbox move process with an on-premise mailbox that you have moved to the cloud, and everything turned out peachy.
The 25MB Item Barrier
Now it is time to move live mailboxes. As you may know, there is a 25MB item size limit for moving items to the cloud. If your internal Exchange connectors are under that, you have nothing to worry about and your migration will soon be completed; but what if your connectors allow items larger than 25MB and most of your soon-to-be-cloud-mailboxes include items larger than that within them?
First off, there are a couple of things you can do to remedy the problem.
My preferred method, is to notify the users that the mail system is not a document repository (there are file shares and SharePoint for that), and to gently coax them into cleaning out their mailboxes.
Here is the process that I normally supply the users with for cleaning out the mailboxes:
- Access the user's on-premises mailbox by using Microsoft Outlook.
- Arrange all items in all folders of the user's mailbox by size. Sort the items from largest to smallest so that the largest items are at the top of the list.
- Locate the items that are larger than 25 MB. If these items contain important info, save them to another location such as the local computer or a local Personal Folders file (.pst). Then, delete the items that are larger than 25 MB from the user's mailbox.
- Make sure that the items are permanently deleted and are not in the “Deleted Items” folder in Outlook. (Shift-Delete)
Solving The Problem With PowerShell
You can do the above via Powershell as well, with the user’s permission. You will need to create new roles and assigned accounts to that role in order to accomplish that. You can accomplish this by using Export-Mailbox cmdlets, once you have been assigned appropriate permissions. The Export-Mailbox cmdlets is out of scope of this document, but I will discuss the permissions due to the fact that what we are trying to accomplish works by the same mechanism.
The important thing to remember is that, anything that goes through the queues to the cloud – mailbox moves, sent messages, etc have to be under 25MB in size. It is a good idea to get the users used to this from the start of your Office 365 migration planning.
You can, of course, run a PowerShell Remove Mailbox Move command with an option to skip larger items, but if you follow that route, the large items will be gone forever. I prefer to work with the users to get the mailboxes cleaned out.
Not So Fast
Now that the user had removed all of the items, you may attempt to move the mailbox again, the mailbox move will most likely fail, and if you look at the log under the Failed the mailbox move request, at the last line, you will see the following error:
“Fatal error TooManyLargeItemsPermanentException has occurred.”
So why are we getting this error, if all of the large items have been removed? To find out, run this command:
Get-MailboxFolderStatistics -Identity onpremtest -IncludeAnalysis | fl Identity,TopSubjectSize
This command lists the largest item size by folder name.
If the user was vigilant in removing the larger items from each folder and subfolder, you will see that all of the folders are showing largest message size smaller than 25MB in size, except for one.
The Deletions Folder
Take a look at the folder towards the bottom of the list named alias\Deletions:
You can get the Dumpster\Deletions information by running the following command, but the item sizes are not listed:
The “Deletions” folder is where your permanently deleted items are hiding. This folder is hidden from Outlook, and is used by Exchange Dumpster for single item recovery without the need of an administrator going to the backup to restore those items.
By default, those items will be in the dumpster for 14 days, and with a migration in progress, chances are, you do not want to wait 14 days for that to be emptied out.
There is a way to empty the dumpster. In order to do that, you can run the following command:
Search-Mailbox –Identity <alias> -SearchDumpsterOnly –DeleteContent
Permissions
If you do not assign the appropriate rights to the account you are running the above command with, you will get the following error when attempting to empty the dumpster for a given mailbox:
If you get errors running this cmdlet, there are two possible things that may be going on:
- You have to be part of “Discovery Management.” If your account is not part of “Discovery Management,” you will not be able to run Search-Mailbox.
- You will need to be assigned “Mailbox Import Export” role. This role is not a pre-canned role, and you will have to run an additional command in order to set this up:
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -Members "<domain\userORgroup>" -DisplayName "Exchange Mailbox Import Export" -Description "This group will provide access to mailbox import and export cmdlets within entire Exchange Organization."
You can use a user or group in place of "<domain\userORgroup>"
After running this, you will notice that a new Universal Security Group – “Exchange Mailbox Import Export” is created in the Microsfot Exchange Security Groups OU in the root domain of the forest.
You will also notice the user or group you specified in the above cmdlets is added as member of that group. The command also creates a Management Role Assignment “Mailbox Import Export – Exchange Mailbox Import Export.”
You can verify this by running:
Get-ManagementRoleAssignment –role “Mailbox Import Export” | ft Identity
It is highly recommended that you restrict the management scope and membership to this group as necessary to comply with your security and administration requirements.
Removing The Dumpster Items
Now, you need to restart your PowerShell session, or open a new one, at which point you will be able to remove the dumpster items:
Once, this is completed, you can run the command to get item sizes again, and you will see that the item size is now 0:
Get-MailboxFolderStatistics -Identity onpremtest -IncludeAnalysis | fl Identity,TopSubjectSize
At this point you should be able to resume the move request to the cloud and it should complete.
Happy moving!
If you need more assistance, email me here.
No comments:
Post a Comment