Friday, 15 May 2015

Auditing and converting Shared Mailboxes after a Cutover, Staged or Third Party migration

Moving mailboxes to Office 365 is a painless experience, providing of course it has been planned carefully. Unless you move mailboxes using Exchange Hybrid you will need to convert your shared mailboxes back to a shared mailbox once they have been moved however. This is the case for Cutover, Staged or using some third party tools like MigrationWiz.
So let's look how we would normally convert one mailbox manually.
1. Once the mailboxes have moved, logon to the tenant and in the Exchange Admin Center, select the mailbox. On the right hand side you will have 'convert to shared mailbox'

2. Selecting this brings up the following warning, select Yes

3. And that's it - the mailbox is now a shared mailbox:

So that's great if you only have one, or a select few shared mailboxes that makes the task of doing this for each one manually a very short, if somewhat mundane affair.
So what happens if you have a lot?
Well you can do it manually like in the scenario above, or we can automate it.
In this case we can audit them in preparation for any move to Office 365.
1. Get a list of all shared mailboxes from on premise Exchange Management Shell session

Get-Mailbox –resultsize unlimited –recipienttypedetails sharedmailbox |Select userprinciplename |Export-CSV

2. This will provide an output like the following. Check the CSV is formatted correctly and clean it up if necessary

Finally, after you have moved the mailboxes, with your Exchange Online PS Session, run the following command:

Import-Csv "csv file" |ForEach { Set-Mailbox –Identity $_.UserPrincipalName –Type shared }

Running Get-Mailbox –Type Shared should then show all required mailboxes have been converted to shared mailboxes.
We can continue to run this command with the full CSV even if not all the shared mailboxes have been moved over, you will simply get an error for the ones that haven't been moved yet, and a yellow informational alert for the ones that already have and thus are already of the type: shared.
In this scenario the mailboxes should not have been licensed, so there's no need to remove any licensing from them as you will still be in the grace period – as Shared Mailboxes do not require a license in Office 365. If for some reason you are facing a scenario where they are, I will post up next week how to clean this up with a remote powershell session to Azure AD for a more automated removal of any assigned license.
Take care,
Oliver Moazzezi – MVP Exchange Server
Twitter: @OliverMoazzezi

No comments: