How to fix problems related to the primary SMTP address in CodeTwo software
When using CodeTwo tools to migrate or back up your data, you receive the following error:
The primary SMTP address must be specified when referencing a mailbox.
When creating a new migration or backup job, you specify which mailboxes you want to migrate or back up by their primary SMTP address, shown in the software. The above error shows up when you change this address on the target server while the migration or backup process is already running. You will also get this error in CodeTwo migration tools if you manually provide an email address that is not the primary SMTP address in the Mailbox matching step (Fig. 1.).
The primary SMTP address may change automatically when you implement a new Email Address Policy or change the domain name. For example, in the case of Office 365, you might receive this error when switching from a default domain (@my-company.onmicrosoft.com) to a custom one (@my-company.com).
To troubleshoot this problem:
- First, check if the email addresses selected in CodeTwo software match the primary SMTP addresses of the mailboxes in question,
- If not, set the correct primary SMTP address for each mailbox you are migrating or backing up.
To check which SMTP address is set as the primary one for a given mailbox, you can use:
- Sign in to your Exchange admin center.
- Go to recipients > mailboxes and check the email address shown in the EMAIL ADDRESS column. This is the primary SMTP address (Fig. 2.).
If you’re using Exchange Server 2010, go to Users & Groups > Mailboxes instead.
- Open the Exchange Management Shell and enter the following command:
Get-Mailbox -Identity <username> | select -expand emailaddresses aliasYou can omit the -Identity parameter (together with the <username> value) if you want to check the primary SMTP addresses for all mailboxes.
- Check the results. If the IsPrimaryAddress value is true (Fig. 3.), this means that the SmtpAddress value above shows the primary SMTP address.
- Connect remotely to Office 365 via Windows PowerShell (learn here how to do so).
- Enter the following command:
Get-Mailbox -Identity <username> | select -expand emailaddresses alias
- Check the results. An email address preceded by the upper-case SMTP prefix (Fig. 4.) is the primary SMTP address.
Exchange 2013 and newer (including Exchange Online)
- Sign in to your Exchange admin center.
- Go to recipients > mailboxes and double-click the user whose primary email address you want to change. The Edit User Mailbox window will open.
- Click email address on the left and double-click the SMTP address that you want to set as primary (Fig. 5.). If you don’t see the desired SMTP address, click the + button and add a new SMTP address.
- In the window that opens, select the Make this the reply address checkbox (Fig. 6.).
Important (applies only to on-premises Exchange servers)
If you don’t see the checkbox shown in Fig. 6., you first need to clear the Automatically update email addresses based on the email address policy applied to this recipient checkbox (Fig. 5.).
- Click ok. The primary SMTP address will be in bold and preceded by the upper-case SMTP prefix. Click save to apply the changes.
The selected SMTP address is now set as a primary email address.
- Open the Exchange Management Console.
- In the left pane, navigate to Microsoft Exchange On-Premises > Recipient Configuration.
- In the center pane, right-click the user for whom you want to change the primary email address and select Properties (Fig. 7.).
- Open the E-Mail Addresses tab. You will see a list with all email addresses. Those in bold are the primary ones. If you don’t see the desired SMTP address, click the Add button, select SMTP Address and in the window that opens provide a new email address (Fig. 8.).
- Select the SMTP address that you want to set as primary and click Set as Reply (Fig. 9.).
If the Set as Reply button is unavailable, you need to clear the Automatically update e-mail addresses based on e-mail address policy checkbox (Fig. 9.).
- Click Apply and OK.
The selected SMTP address will now be your primary email address.