Categories
How-To Technical

Office 365: Convert Mailbox to Shared Mailbox after Cutover Migration

When performing a cut-over migration the Exchange attribute indicating that the mailbox was a shared mailbox is lost. To correct this I have done the following steps:

List out all of the shared mailboxes form my on-premises Exchange and export them into a CSV file.

Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox | Select UserPrincipalName | Export-Csv -Path .\shared_mailbox_users.csv -NoTypeInformation

Now prepare the CSV file with the list of user principal names of all mailboxes to be converted. Make sure the column header for the user principal names is “UserPrincipalName”

Now we run the following powershell script to change the mailbox type of all items in the CSV file.

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

Write-Host "Type in the complete path to the location of the csv. Or you can drag and drop the CSV file onto this window."
$csv = Read-Host

Write-Host "These are the mailboxes in the uploaded list."
$mailboxes = Import-Csv $csv
$mailboxes.UserPrincipalName

Write-Host ""; Write-Host ""; Write-Host ""
Write-Host "Continue execution? Y or N"
$permit = Read-Host

If($permit -like "y*")
{
    $mailboxes | foreach{
        $contextName = $_.UserPrincipalName
        Set-Mailbox $contextName -Type shared -Confirm:$false
    }
}

Remove-PSSession $Session

Please note

Running Exchange Online Powershell commands / scripts requires you have had installed the Microsoft Online Service Sign-In Assistant, Windows Powershell, Windows Azure Active Directory Powershell

For more info:

http://www.microsoft.com/en-us/download/details.aspx?id=41950

http://jermsmit.com/azure-active-directory-module-for-windows-powershell-how-to-connect/

 

One reply on “Office 365: Convert Mailbox to Shared Mailbox after Cutover Migration”

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.