The fastest solution is to bulk add the missing <domain>.mail.onmicrosoft.com SMTP proxy addresses to all affected mailboxes using PowerShell. Run Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Set-Mailbox -EmailAddresses @{add="youralias@yourdomain.mail.onmicrosoft.com"} in Exchange Management Shell.

Fix Exchange Migration Error – Target Mailbox SMTP Proxy Missing – Exchange Online 2026
Exchange mailbox migration fails when target mailbox lacks required onmicrosoft.com SMTP proxy address. Fix by adding missing proxy addresses using PowerShell cmdlets or bulk scripts.
Understanding Exchange Migration SMTP Proxy Errors
Exchange mailbox migrations to Microsoft 365 can fail when target mailboxes lack the required SMTP proxy addresses matching the tenant's onmicrosoft.com domain. This error typically occurs during hybrid Exchange deployments when migrating from on-premises Exchange servers to Exchange Online.
The error "Target mailbox doesn't have an SMTP proxy matching" indicates that the source mailbox in your on-premises Exchange environment is missing the crucial proxy address that Exchange Online uses for mail routing. Every mailbox being migrated must have an SMTP proxy address in the format username@yourdomain.mail.onmicrosoft.com to ensure proper mail flow and migration success.
This issue commonly affects organizations during their Microsoft 365 migration journey, particularly those with custom email address policies or incomplete hybrid configurations. The problem can impact individual mailboxes or entire migration batches, causing significant delays in cloud adoption projects. Understanding the root causes and implementing the correct fixes ensures smooth mailbox transitions and maintains business continuity during the migration process.
Symptoms
- Mailbox migration status shows as "Failed" in Exchange Admin Center
- Error message: "Target mailbox doesn't have an SMTP proxy matching '<domain>.mail.onmicrosoft.com'"
- Migration batch reports incomplete with proxy address errors
- Hybrid configuration wizard shows connectivity issues
- PowerShell migration commands return proxy matching errors
- Exchange Online mailboxes cannot receive mail from on-premises
Root Causes
- Source mailbox missing required
<domain>.mail.onmicrosoft.comSMTP address - Azure AD Connect not syncing proxy addresses correctly
- Manual mailbox creation without proper SMTP proxy configuration
- Incomplete hybrid configuration missing routing domains
- Directory synchronization filtering excluding proxy addresses
- Custom recipient policies overriding default proxy generation
Solutions
Add Missing SMTP Proxy Using Exchange Management Shell
This method adds the missing SMTP proxy address to individual mailboxes using Exchange PowerShell commands.
- Open Exchange Management Shell as administrator on your Exchange server
- Connect to your on-premises Exchange environment:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn - Identify mailboxes missing the proxy address (replace 'yourdomain' with your actual tenant name):
Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Select-Object UserPrincipalName,Alias - Add the missing SMTP proxy to a single mailbox:
Set-Mailbox -Identity "username@domain.com" -EmailAddresses @{add="username@yourdomain.mail.onmicrosoft.com"} - Verify the proxy was added:
Get-Mailbox -Identity "username@domain.com" | Select-Object -ExpandProperty EmailAddresses
Bulk Add SMTP Proxies Using PowerShell Pipeline
This method efficiently adds the missing SMTP proxy addresses to all affected mailboxes in a single operation.
- Launch Exchange Management Shell with administrative privileges
- Run the bulk update command (replace 'yourdomain' with your tenant name):
Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | ForEach-Object { Set-Mailbox -Identity $_.Identity -EmailAddresses @{add="$($_.Alias)@yourdomain.mail.onmicrosoft.com"} } - Monitor the progress and check for any errors in the output
- Verify all mailboxes now have the proxy address:
Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddresses -like "*@yourdomain.mail.onmicrosoft.com"} | Measure-Object - Force directory synchronization to update Azure AD:
Start-ADSyncSyncCycle -PolicyType Delta
Use PowerShell Script for Advanced Proxy Management
This method uses a comprehensive PowerShell script to handle complex scenarios and provide detailed logging.
- Create a new PowerShell script file named
Add-SMTPProxy.ps1 - Copy the following script content:
# Exchange SMTP Proxy Addition Script param( [Parameter(Mandatory=$true)] [string]$TenantDomain ) $ErrorActionPreference = "Continue" $LogFile = "C:\Temp\SMTPProxy-$(Get-Date -Format 'yyyyMMdd-HHmmss').log" function Write-Log { param([string]$Message) $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" "$Timestamp - $Message" | Tee-Object -FilePath $LogFile -Append } Write-Log "Starting SMTP proxy addition for domain: $TenantDomain" $MailboxesWithoutProxy = Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -notlike "*@$TenantDomain.mail.onmicrosoft.com"} Write-Log "Found $($MailboxesWithoutProxy.Count) mailboxes without proxy" foreach ($Mailbox in $MailboxesWithoutProxy) { try { $ProxyAddress = "$($Mailbox.Alias)@$TenantDomain.mail.onmicrosoft.com" Set-Mailbox -Identity $Mailbox.Identity -EmailAddresses @{add=$ProxyAddress} Write-Log "SUCCESS: Added proxy $ProxyAddress to $($Mailbox.UserPrincipalName)" } catch { Write-Log "ERROR: Failed to add proxy to $($Mailbox.UserPrincipalName) - $($_.Exception.Message)" } } Write-Log "Script completed. Check log file: $LogFile" - Save the script and run it from Exchange Management Shell:
C:\Scripts\Add-SMTPProxy.ps1 -TenantDomain "yourdomain" - Review the log file for any errors or issues
- Verify the results using the verification steps below
Fix Azure AD Connect Synchronization Issues
This method addresses synchronization problems that prevent proxy addresses from syncing to Exchange Online.
- Open Azure AD Connect on your sync server
- Navigate to Configure → Customize synchronization options
- Verify that Exchange hybrid deployment is enabled
- Check the Optional features section and ensure Exchange Mail Public Folders is selected if applicable
- Review the Filtering configuration:
- Go to Domain and OU filtering
- Ensure all relevant OUs containing mailboxes are selected
- Check attribute filtering:
Get-ADSyncConnectorRunProfile -ConnectorName "domain.com" | Where-Object {$_.Name -eq "Full Synchronization"} - Force a full synchronization:
Start-ADSyncSyncCycle -PolicyType Initial - Monitor synchronization status:
Get-ADSyncSyncCycleResult
Configure Email Address Policies for Automatic Proxy Generation
This advanced method ensures future mailboxes automatically receive the correct SMTP proxy addresses.
- Open Exchange Admin Center and navigate to Mail flow → Email address policies
- Create a new email address policy or edit the existing default policy
- Click Add email address format and configure:
- Email address type: SMTP
- Email address format:
@yourdomain.mail.onmicrosoft.com - Make this the reply address: Unchecked
- Set the policy priority to ensure it applies correctly
- Apply the policy to existing mailboxes using PowerShell:
Get-Mailbox -ResultSize Unlimited | Update-EmailAddressPolicy - Verify the policy application:
Get-EmailAddressPolicy | Get-Recipient -ResultSize Unlimited | Select-Object Name,EmailAddresses - Test with a new mailbox creation to ensure automatic proxy generation
- Update the hybrid configuration to recognize the new routing domain:
Set-HybridConfiguration -Domains @{Add="yourdomain.mail.onmicrosoft.com"}
Verification
After applying any of the above methods, verify the fix using these steps:
- Check that all mailboxes now have the required SMTP proxy:
The count should be zero if all mailboxes have the proxy.Get-Mailbox -ResultSize Unlimited | Where-Object {$_.EmailAddresses -notlike "*@yourdomain.mail.onmicrosoft.com"} | Measure-Object - Verify specific mailbox proxy addresses:
Get-Mailbox -Identity "testuser@domain.com" | Select-Object -ExpandProperty EmailAddresses - Test the migration batch again from Exchange Admin Center or PowerShell:
Get-MigrationBatch | Get-MigrationUser | Where-Object {$_.Status -eq "Failed"} - Confirm Azure AD synchronization completed successfully:
Get-ADSyncSyncCycleResult | Select-Object Result,StartTime,EndTime
Advanced Troubleshooting
If the above methods didn't resolve the issue, try these advanced troubleshooting steps:
- Check for duplicate proxy addresses: Run
Get-Mailbox -ResultSize Unlimited | Where-Object {($_.EmailAddresses | Where-Object {$_ -like "*@yourdomain.mail.onmicrosoft.com"}).Count -gt 1}to identify conflicts. - Verify tenant domain configuration: In Microsoft 365 Admin Center, go to Settings → Domains and confirm your onmicrosoft.com domain is properly configured.
- Reset hybrid configuration: Run the Hybrid Configuration Wizard again to refresh routing and proxy settings.
- Check Exchange Online recipient limits: Ensure your tenant hasn't reached mailbox limits that could prevent migration.
- Review migration endpoint connectivity: Test connection using
Test-MigrationServerAvailability -ExchangeRemoteMove -RemoteServer "mail.domain.com" -Credentials (Get-Credential) - Clear migration cache: Remove and recreate the migration batch if proxy issues persist after adding addresses.
Frequently Asked Questions
What is the onmicrosoft.com SMTP proxy address and why is it required?+
Can I migrate mailboxes without adding the onmicrosoft.com proxy addresses?+
How do I find my tenant's onmicrosoft.com domain name?+
Will adding onmicrosoft.com proxy addresses affect my users' email addresses?+
What should I do if the PowerShell commands fail with permission errors?+
Further Intelligence
Deepen your knowledge with related resources
Discussion
Share your thoughts and insights
Sign in to join the discussion




