skip to Main Content

Target mailbox doesn’t have an SMTP proxy matching

You are migrating mailboxes from Exchange on-premises to Exchange Online in Office 365. This time an error is showing that the mailbox status failed. The target mailbox doesn’t have an SMTP proxy matching ‘<domain>’. Why is it happening, and what is the solution to it? In this article, you will learn how to solve the status failed when migrating mailbox to Exchange Online.

Solution to target mailbox doesn’t have an SMTP proxy matching

This issue may occur if one of the following conditions is true:

  • The source mailbox isn’t stamped to have a <domain> SMTP address.
  • The proxy address <domain> is not synced to Office 365 on the corresponding cloud mail-user object.

It’s important to add the proxy address <domain> to the mailboxes. If you don’t do that, you can’t proceed further. The mailbox migration will fail. The fastest way to solve this is to bulk add the <domain> to all the mailboxes.

Target mailbox doesn’t have an SMTP proxy matching error

Get list mailboxes without <domain> SMTP address

Run Exchange Management Shell as administrator and connect to the on-premises Exchange Server. List all the mailboxes with the missing <domain> SMTP address.

In my example, <domain> is the address. Change exoip to the name of your tenant.

[PS] C:\>Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*"} | Select-Object UserPrincipalName,Alias

UserPrincipalName           Alias
-----------------           -----     Amanda.Morgan        Anna.Welch     Benetiz.Anees    Boris.Campbell        Carl.Kelly Christopher.Payne

Get list mailboxes with <domain> SMTP address

Do you like to have a list with all the mailboxes that have the <domain>.mail.onmicrosoft SMTP address? Change -notlike to -like and run the cmdlet.

[PS] C:\>Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -like "*"} | Select-Object UserPrincipalName,Alias

UserPrincipalName        Alias
-----------------        -----     Kyle.Peake Kylie.Davidson   Larson.Tevin Madeleine.Ross

We know why the error target mailbox doesn’t have an SMTP proxy matching is showing. We listed which mailboxes are missing the SMTP address. In the next step, we are going to bulk add the missing SMTP address to the mailboxes.

Bulk add <domain> SMTP address with PowerShell

We have two options to set the <domain> SMTP address to all the mailboxes.

Option 1: Bulk add <domain> SMTP with two PowerShell cmdlets

Run the following two cmdlets to set the as a secondary SMTP address.

[PS] C:\>$NoSMTP = Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*"}

[PS] C:\>$NoSMTP | ForEach {Set-Mailbox -Identity $_.UserPrincipalName -EmailAddresses @{add=$_.Alias+""}}

Option 2: Bulk add <domain> SMTP with PowerShell script

Create two folders with the name scripts and temp in the (C:) drive. Download the PowerShell script Add-onmicrosoft-SMTP.ps1 and place it in C:\scripts folder. You can copy the below code and paste it into Notepad. Save the file as Add-onmicrosoft-SMTP.ps1 in the C:\scripts folder. After running the script, the output will be logged to the temp folder with the file name Add-onmicrosoft-SMTP.log.

# Output will be added to C:\temp folder. Open the Add-onmicrosoft-SMTP.log with a text editor. For example, Notepad.
Start-Transcript -Path C:\temp\Add-onmicrosoft-SMTP.log -Append

# Get all mailboxes
$Mailboxes = Get-Mailbox -ResultSize Unlimited

# Loop through each mailbox
foreach ($Mailbox in $Mailboxes) {

    # Search for SMTP in every mailbox
    $OnMicrosoftAddress = $Mailbox.EmailAddresses | Where-Object { $_ -like "*" }
    # Do nothing when there is already an SMTP configured
    If (($OnMicrosoftAddress | Measure-Object).Count -eq 0) {

        # Change exoip with the domain name that you want to add as SMTP
        $OnMSAddress = "$($Mailbox.Alias)"

        # Set onmicrosoft SMTP address
        Set-Mailbox $Mailbox.DistinguishedName -EmailAddresses @{add = $OnMSAddress }

        # Write output
        Write-Host "Adding $($OnMSAddress) to $($Mailbox.Name) Mailbox" -ForegroundColor Green


Let’s see the PowerShell script in action. Run Exchange Management Shell as administrator. Change the directory to the scripts folder and run the script. The PowerShell script will go through the Exchange On-premises mailboxes and add the <domain> to every mailbox as a secondary SMTP address.

[PS] C:\>cd \scripts
[PS] C:\scripts>.\Add-onmicrosoft-SMTP.ps1
Transcript started, output file is C:\temp\Add-onmicrosoft-SMTP.log
Adding to Amanda Morgan Mailbox
Adding to Anna Welch Mailbox
Adding to Benetiz Anees Mailbox
Adding to Boris Campbell Mailbox
Adding to Carl.Kelly Mailbox
Adding to Christopher Payne Mailbox
Transcript stopped, output file is C:\temp\Add-onmicrosoft-SMTP.log

The last step is to verify the results and ensure that we will not see the error target mailbox doesn’t have an SMTP proxy matching when migrating mailboxes to Exchange Online.

Verify the results

If you used option 2 to set the <domain> SMTP with the PowerShell script, check the log file. Go to the C:\temp folder and open the file Add-onmicrosoft-SMTP.log with the application Notepad.

Target mailbox doesnt have an SMTP proxy matching log

Run the cmdlet to check if there are mailboxes configured without the SMTP <domain> The output is empty after running the cmdlet. That’s because all the mailboxes are configured with the <domain>

[PS] C:\>Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*"}

Did it help you solve the error target mailbox doesn’t have an SMTP proxy matching?

Read more: Complete migration batch with PowerShell »


You learned why the error target mailbox doesn’t have an SMTP proxy matching is showing. Add the <domain> SMTP to the mailboxes with the PowerShell cmdlets shown in this article. After setting the SMTP address, run Azure AD Connect to sync the on-premises environment with the cloud. Move the mailbox to Exchange Online and look at the move request. This time the error is not showing anymore.

Did you enjoy this article? You may also like Get move request batch in Exchange Online. Don’t forget to follow us and share this article.



ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 5 Comments

  1. I am getting the same warning when trying to move some mailboxes to EXO. The SMTP proxy has been added to the accounts and has syncd to AAD and I can see it there. But the mailbox move still fails with the same error. Any ideas?

  2. Hi Ali!
    I have the following problem: the mailbox was migrated to EXO but for some unknown reason, the Exchange Online mailbox does not have the secondary SMTP address However, looking at the Exchange On-Prem MEU object, that address exists as a secondary SMTP address. And it is also configured as Remote Routing Address. Apparently the Azure AD Connect server is not syncing the change to Azure AD but I do not see any error. I would appreciate any help from you! Thank you!

  3. i have added the SMTP proxy matching ‘ but when i go to migrate the mailbox it still gives me the error message saying

    “The target mailbox doesn’t have an SMTP proxy matching “’.

    How can i fix this?

Leave a Reply

Your email address will not be published.