Prechecks when user mailboxes are migrating from Exchange On-premises to Exchange Online

Neha AgarwalSenior Consultant-CG
Published:
Updated:
Edited by: Andrew Leniart
The purpose of this article is to dump all the permissions, access, attributes of the user mailbox before migrating the mailbox from On-Premises to Online

Before migrating each user mailbox from On-premises to Online, all important permissions and attribute values like UserPrincipalName, DisplayName, PrimarySMTPAddress, Full access permission, send as permission, GUID, Mailbox item count, Mailbox size etc should be Exported so that if needed, values could be compared with values after a mailbox migration.


Check if each users mailbox SMTP address has an onmicrosoft address

 

When you are migrating a user mailbox from on-premises to online, the user mailbox must contain one mail address with domain @domainname.mail.onmicrosoft.com. If it is not there, then your mailbox migration will fail so this is a very important step. To find out whether the mailbox has the needed appropriate addresses;


Get-MailboxDatabase | Get-Mailbox -Filter “emailaddresses -notLike ‘*@domainname.mail.onmicrosoft.com’


Displayname and Guid


This command fetches all the display names and GUID of the mailbox which is required to be migrated. GUID plays an important role if your mailbox is deleted by mistake and you want to recreate the same mailbox.


Get-Content "C:\script\alias.txt" | Get-Mailbox | select samaccountname,displayname,guid | ft -Wrap


Primary SMTP Address

This is a significant step to export all the primary SMTP addresses as many times it happens then when we are migrating users to online, the default SMTP address gets changed to another address. With these values, we can compare pre and post values.


Get-Content "text doc with alias.txt” | Get-ADUser -Properties ProxyAddresses | select -ExpandProperty ProxyAddresses | ? {$_ -clike "SMTP:*"}

IsLinked,IsShared,IsResource,IsRootPublicFolderMailbox,RecipientType and RecipientTypeDetails

This will give the details of the mailbox.

Get-Content "txt doc with alias" | Get-Mailbox | select SamAccountName,IsLinked,IsShared,IsRes

ource,IsRootPublicFolderMailbox,RecipientType,RecipientTypeDetails | ft –Wrap


Mailbox Total Item Size

Total item size of the mailbox is important to fetch to check if the pre and post migration size is the same. It is also important to know the sizes of the mailbox to arrange the batches of migration as to how much size can be migrated in a day. Accordingly, you will need to check the network bandwidth.


Get-Content "txt doc with Alias" | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize  | Sort-Object TotalItemSize


Mailbox Total Item Count

Total item count is important to be exported before migration so that if any user comes to the administrator stating that a few items in the mailbox are missing, then that can be verified from this sheet.


Get-Content "path of txt file with alias.txt" | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics |Select DisplayName,StorageLimitStatus,@{name="TotalItemSize (MB)"; expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}}, `ItemCount | Sort "TotalItemSize (MB)" -Descending



LegacyExchangedn

The LegacyExchangeDN is required for mail-enabled Exchange objects, including mail-enabled contacts.


Get-Content "txt doc with Alias" | Get-Mailbox | select samaccountname,displayname,Legacyexchangedn | ft –Wrap


ProxyAddressAttribute

A proxy address is an address by which a Microsoft Exchange Server recipient object is recognized in a foreign mail system. The below command would fetch all the proxy addresses for the users to be migrated online.


Get-Content "text doc with alias.txt” | Get-ADUser -Properties ProxyAddresses | select -ExpandProperty ProxyAddresses


MaxRecieveSize ,MaxSendSize and Recipient Limit

35MB is the max send/receive size limit in O365. The command will fetch the limits of all the users which are going to be migrated. If any user in an organization has more than a 35MB limit, then the same can be communicated to the user in advance about the changes.


$mb= Get-Content "path of txt file with alias.txt"| Get-Mailbox -ResultSize unlimited;

$mb | where {$_.RecipientTypeDetails -eq 'UserMailbox'} | Format-Table Name,MaxReceiveSize,MaxSendSize,RecipientLimits


POP3 Enabled

When a user mailbox is migrated from Exchange on-premise to Exchange Online, by default the POP3 service is enabled on the individual mailbox. So it is important to export this information prior to moving the mailbox so that we can apply the same settings once the mailbox migrated.


Get-Content "path of txt file with alias.txt" | Get-CASMailbox | where {$_.PopEnabled -eq $true} | FL name


IMAP Enabled

When the user mailbox is migrated from Exchange on-premise to Exchange Online, by default the IMAP service is enabled on the individual mailbox. So it is important to export this information prior to moving the mailbox so that we can apply the same settings once the mailbox migrated.


Get-Content "path of txt file with alias.txt""| Get-CASMailbox | where {$_.IMAPEnabled -eq $true} | FL name


Forwarding set

User mailbox on which Forwarding is set, both should be migrated at the same time to keep the settings intact or else the forwarding set would be revoked.


Get-Content "path of txt file with alias.txt" | Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward | fl


Active Sync enabled and policy applied

When a user mailbox is migrated from Exchange on-premise to Exchange Online, by default the Active Sync service is enabled on an individual mailbox with the default policy. So it is important to export this information prior to moving the mailbox so that we can apply the same settings once the mailbox migrated.


Get-Content "path of txt file with alias.txt" |Get-CasMailbox -Filter {ActiveSyncEnabled -eq $true} | Where-Object { $_.Identity -LIKE "domain/*" } | Select-Object OU, DisplayName, ActiveSync* | Export-CSV D:\test\activesync.csv



Send As Permissions


Get-Content "path of txt file with alias.txt"| Get-Mailbox | Get-ADPermission | where {($_.ExtendedRights -like “*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”)} | FT -Wrap


Full Access Permissions

User mailbox on which full access permission of other mailbox is set, both should be migrated at the same time to keep the settings intact or else permissions would be revoked.


Import-Csv “Path of user list with Alias” | foreach-object {Get-Mailbox -RecipientTypeDetails SharedMailbox | Get-MailboxPermission | where { ($_.AccessRights -eq “FullAccess”) -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) }}


SendOnBehalf Permissions

User mailbox on which SendOnBehalf access permission of other mailbox is set, both should be migrated at the same time to keep the settings intact or else permissions would be revoked.


Get-Content "path of txt file with alias.txt"| Get-Mailbox -Filter {GrantSendOnBehalfTo -ne $Null} |Select Alias, @{Name='GrantSendOnBehalfTo';Expression={[string]::join(";", ($_.GrantSendOnBehalfTo))}} | Export-Csv -NoType -encoding "unicode" C:\*location*\MailboxesSendOnBehalf.csv


I Hope this article will help Administrators keep the prechecks ready to assist in a smooth migration.



0
1,269 Views
Neha AgarwalSenior Consultant-CG

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.