After migrating your Exchange Online mailboxes to the new tenant. You might want to disable the access to the mailboxes in the old tenant for your end users. This can help reduce the confusions for the end users and save the possible IT helpdesk workloads.
To "Freeze" the mailboxes in the old tenant. You can disable the protocols of the old mailboxes. Try the powershell scripts below to disable the protocols for the migrated mailboxes.
#Get CSV file
$MailBoxes = Import-Csv -Path .\AllMailboxes.csv
Connect-ExchangeOnline
foreach ($mailbox in $Mailboxes) {
Set-CASMailbox $mailbox.Email -ActiveSyncEnabled $false -ImapEnabled $false -EwsEnabled $false -MAPIEnabled $false -OWAEnabled $false -PopEnabled $false -OWAforDevicesEnabled $false
write-host "Processing mailbox: " $mailbox.Email
Get-CASMailbox -Identity $mailbox.Email | Select DisplayName,EwsEnabled,ActiveSyncEnabled,MAPIEnabled,OWAEnabled,ImapEnabled,PopEnabled,OWAforDevicesEnabled
}
foreach ($mailbox in $Mailboxes) {
write-host "Processing mailbox: " $mailbox.Email
Get-CASMailbox -Identity $mailbox.Email | Select DisplayName,EwsEnabled,ActiveSyncEnabled,MAPIEnabled,OWAEnabled,ImapEnabled,PopEnabled,OWAforDevicesEnabled
}