Step by Step Guide to Move Office 365 Mailbox to Another User Account

Oftentimes, it is needed to perform batch export from one Office 365 account to another account. There are many users under a single admin account. So, need to transfer these mailboxes arises very frequently. The post deals with the best possible solution to perform Office 365 cross tenant migration. So, let us begin.

Workaround Solution to Transfer Mailboxes from One O365 Account to Another

A user has to follow the given set of instructions to transfer Office 365 domain to another account:

Step 1: Start to Plan Before 3 Days

Prepare Primary and Aimed Account: To make modifications in the processing accounts, follow these set of instructions:

  1. Make sure that a particular destination tenant is for the source Exchange Online domain.
  2. Add the source account to the destination Office 365 account. Create a TXT record when you are done with this.
  3. DNS record needs your 72 hours to exhibit the circulation
    Note: Make sure that the source and destination tenant mailboxes are not used by any other application.

Office 365 Cross Tenant Migration Platform Setup

  • Generate a list of mailboxes of all which are to be migrated
  • Map the targeted and source tenant mailboxes, if it is required to include them.

Preparation of Office 365 Source Account

  • Delete the targeted email ID of Exchange online tenant wherever it is configured.
  • Reset all the URLs to the initial point if the account configuration is complete
  • Remove Microsoft Lync licensing with the help of the Lync admin portal
  • Create a setting where the default email ID of mailboxes of targeted account has been entered. Once the procedure till now is complete, reset all the email addresses on rooms, distribution list, and resources to the initial point.

Preparation of Office 365 Target Account

  • If you are using AD FS then, launch target Office 365 account and generate new domains within it.
  • Grant all the permissions and licenses needed for migration to another new account for Office 365 tenant migration
  • Establish the primary account as a basic mailing address
  • In case, the user is not using the password sync feature or AD FS then, the password of every mailbox is to be mentioned in account domain
  • Check the mail flow for testing how the account works under different environment.

Step 2: Change the Exchange Online Passwords in Batch

  1. Launch an Excel spreadsheet and generate CSV file and name it as ‘password.csv’
  2. In this Excel file, make two columns with the name ‘upn’ and ‘password’
  3. Insert all the account credentials in this sheet
  4. Run MS Exchange PowerShell window and execute the following command to perform Office 365 tenant to tenant migration:
    Import-Csv password.csv|%{Set-MsolUserPassword –userPrincipalName $_.upn -NewPassword $_.newpassword -ForceChangePassword $false}

Step 3: Copy the Messages

Execute these PowerShell commands to start copying messages from the basic domain to any particular proxy addresses present in the CSV file:

# Script: showproxies.ps1

# Copies all accounts in Office 365 that contain/don't contain a specific 

# proxyaddress to a .CSV file (addresses.csv) 

#  

# Change the following variable to the proxy address string you want to find:

# $proxyaddr = "onmicrosoft.com"  

################################################################################


$proxyaddr = "onmicrosoft.com" 


# Create an object to hold the results

$addresses = @()  

# Get every mailbox in the Exchange Organisation

$Mailboxes = Get-Mailbox -ResultSize Unlimited

# Loop through the mailboxes

ForEach ($mbx in $Mailboxes) {  

    # Loop through every address assigned to the mailbox

    Foreach ($address in $mbx.EmailAddresses) {  

       # If it contains XXX,  Record it  

        if ($address.ToString().ToLower().contains("onmicrosoft.com")) {  

            # This is an email address. Add it to the list  

            $obj = "" | Select-Object Alias,EmailAddress  

            $obj.Alias = $mbx.Alias  

            $obj.EmailAddress = $address.ToString() #.SubString(10)  

            $addresses += $obj  

      }  

    }  

}  

# Export the final object to a csv in the working directory 
 
$addresses | Export-Csv addresses.csv -NoTypeInformation  

# Open the csv with the default handler  

Invoke-Item addresses.csv 
 
##### END OF SHOWPROXIES.PS1

Step4: For Office 365 Tenant, Create a Room Mailbox

Follow these commands to perform Office 365 cross tenant migration:

Script: create-rooms.ps1

#  Description:*** RUN THIS SCRIPT FROM A WINDOWS POWERSHELL SESSION ***

#This script creates Room mailboxes in Office 365.

# Syntax:Create-Rooms.ps1 -inputfile "file name.csv"

#

# Dependencies: Input file should contain 3 columns: RoomName, RoomSMTPAddress, RoomCapacity

#

################################################################################


param( $inputFile )


Function Usage

{

$strScriptFileName = ($MyInvocation.ScriptName).substring(($MyInvocation.ScriptName).lastindexofany("\") + 1).ToString()


@"


NAME:

$strScriptFileName

EXAMPLE:

C:\PS> .\$strScriptFileName -inputfile `"file name.csv`"


"@

}


If (-not $inputFile) {Usage;Exit}



#Get MSO creds and initialize session

If ($cred -eq $NULL) {$Global:cred = Get-Credential}


#

If ($ExchRemoteCmdlets.AccessMode -ne "ReadWrite")

{

Write-Host

Write-Host Connecting to Office 365...

Write-Host

$NewSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection

$Global:ExchRemoteCmdlets = Import-PSSession $NewSession

}


#Import the CSV file

$csv = Import-CSV $inputfile


#Create Rooms contained in the CSV file

$csv | foreach-object{


New-mailbox -Name $_.RoomName -room -primarysmtpaddress $_.RoomSMTPAddress -resourcecapacity $_.RoomCapacity


}

##### END OF CREATE-ROOMS.PS1

 

Step 5: Delete The Secondary Addresses from Office 365 Mailboxes

Run the following commands to move a domain from one Office 365 tenant to another:

#Script:  remove-proxy.ps1

#Description:*** RUN THIS SCRIPT FROM A WINDOWS POWERSHELL SESSION ***

#This script will remove a secondary email address from many users 

#

# Syntax:remove-proxy.ps1 -inputfile "filename.csv"

#

# Dependencies:Input file should contain 2 columns: Username, Emailsuffix 

#               Example:  Username=tim, Emailsuffix=fabrikam.com 

#Script will remove the address tim@fabrikam.com from the mailbox for Tim.

#NOTE: Address must be secondary; it will not remove primary email address.

#

################################################################################


param( $inputFile )


Function Usage

{

$strScriptFileName = ($MyInvocation.ScriptName).substring(($MyInvocation.ScriptName).lastindexofany


("\") + 1).ToString()


@"


NAME:

$strScriptFileName


EXAMPLE:

C:\PS> .\$strScriptFileName -inputfile `"file name.csv`"


"@

}


If (-not $inputFile) {Usage;Exit}



#Get MSO creds and initialize session

If ($cred -eq $NULL) {$Global:cred = Get-Credential}


#

If ($ExchRemoteCmdlets.AccessMode -ne "ReadWrite")

{

Write-Host

Write-Host Connecting to Office 365...

Write-Host

$NewSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 


https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection

$Global:ExchRemoteCmdlets = Import-PSSession $NewSession

}


#Import the CSV file and change primary smtp address


$csv = Import-CSV $inputfile

$csv | foreach-object{



# Set variable for email address to remove

$removeaddr = $_.username + "@" + $_.emailsuffix

Write-Host ("Processing User: " + $_.UserName +" - Removing " + $removeaddr)


Set-Mailbox $_.Username -EmailAddresses @{Remove=$removeaddr} 


}


##### END OF REMOVE-PROXY.PS1

Drawbacks of the Manual Approach

This method involves some limitations when it comes to Office 365 tenant migration. These are written as follows:

  • The process is very time-consuming. It takes almost days to complete the entire procedure.
  • Also, this method should only opt when the admin has a deep technical knowledge regarding Office 365 accounts.
  • The steps can be only executed by an admin who has permissions to access all the users’ account.
  • Any mistake committed at any point can lead to loss of data
  • There is no surety that the data will be kept intact in the manual approach.

Alternative Solution to Perform Office 365 Cross Tenant Migration

To overcome all the limitations, a user can go with the automated tool like Office 365 to Office 365 migration tool. According to the experts, it is the best possible solution to migrate the tenant mailboxes from one Office 365 account to another. The software is very simple to use. Just a few clicks and the desired results are obtained.

The Final Verdict

It is demanded by various Office 365 users to move the mailboxes from one account to the other. The post deals with the best possible solutions to perform Office 365 cross tenant migration. There are some drawbacks of the manual technique. So, a professional software is also explained. This utility can be simply used even by a non-technical user.