Troubleshooting server connection

No matter if you configure the EWS connection to a source/target Exchange Server or to a source Office 365 tenant, the first action (test) performed by the program is always checking the connection to your server (Exchange Server, as shown in Fig. 1., or Office 365). During this operation, the software tries to access the mailbox of an admin account provided in the previous step of the wizard. If the program cannot connect to your server (Fig. 1.), click the Details link on the right side of the configuration wizard to see more information.

Exchange Migration EWS wizard failure 1
Fig. 1. Failure to connect to source Exchange Server.


To minimize the risk of connection errors, we advise enabling trust relationship between the source and the target server.

Learn more about creating a forest trust on Windows Server 2008 and newer.

Study the examples below that show the most common server connectivity issues:

The request failed. The remote server returned an error: (401) Unauthorized.

The error message is produced when the wrong target server administrator account has been chosen, the admin account  is not mailbox-enabled (doesn't have the necessary license assigned that includes the Exchange Online plan, in case of Office 365), or the admin's email address is different than its UPN (User Principal Name). You must make sure that provided credentials are the right ones and that they match the UPN. If you are still using the pre-Windows down level logons (DOMAIN\user) you must create a UPN for the purpose of the migration.

This error may also appear when configuring a connection to Office 365 by using an account that has multi-factor authentication (MFA) enabled. Enter the app password instead of your regular Office 365 password when providing the admin account credentials. You can also disable MFA for that account or use another account that is not MFA-enabled. Read more about managing MFA for Office 365 users.

The request failed. The underlying connection was closed: An unexpected error occurred on a receive.

The reason you experience this problem is that you might be using the software version that does not support TLS 1.2 and is therefore not able to connect to Office 365 services. Make sure you have the latest version of CodeTwo Exchange Migration installed (click the Check for updates link on the Dashboard tab to check that). Read more about problems related to the old TLS protocols and how to troubleshoot them

The request failed. Unable to connect to the remote server.

This error occurs if the domain name in the administrator's email address is misspelled or the password is wrong. To fix the problem, go to the previous step of the connection wizard and make sure to enter correct credentials. A similar message is also shown if the EWS URL is wrong. In that case, go to the first step of the wizard and enter a correct EWS URL.

Failed to find in Active Directory an email address for [email address].

Exchange Server doesn't support the requested version.

These errors may appear when you choose a source/target Exchange Server version that is not supported by the program. When using EWS connection, CodeTwo Exchange Migration can be used to migrate mailboxes between the following versions of Exchange Servers: 2019, 2016, 2013, 2010 SP1, and SBS 2011.

The request failed. The remote server returned an error: (403) Forbidden.

The error message is produced when there is a problem connecting to the source/target server. Make sure you provided the right name or IP address of the server and the right EWS server address. To check this, you can copy-paste the EWS server address (EWS URL) from the program's settings into your web browser when you are logged in to the source server. If you don't get a credentials request pop-up window, this might mean that you provided wrong EWS server URL or IP.

Account mismatch.

This error informs you that the program has found a conflict with the admin account's ID – used credentials no longer connect to the same environment as previously. This is a security measure that prevents any problems that may occur due to changes made in your source or target environment. Once you receive this error, you will not be able to continue with the migration process (including running Rescan), refresh email addresses or reset the migration state. To fix the problem, you need to reconfigure the source and/or target connection by using new admin credentials (with different UPN / email address) that will allow you to connect to the desired server.

This error is most likely to occur after changing the domain on the source and/or target server This especially applies to the situation where you have transferred the domain from the source server to the target server – the existing source connection might connect to your target server instead. The program also detects if you have deleted the admin account (used previously in the program) on your server and then created a new one, with the same UPN / email address. Such an account will be recognized as a new mailbox (as it has a different GUID) and migrated from scratch (and consume another license) in the program. In case none of the above situations took place and you still want to use the same admin credentials, contact CodeTwo Support.


When configuring connections to your Office 365 tenants, we recommend using an admin's account primary email address from the * or * domain, assigned to you by Microsoft. That way no conflicts will occur when you change the domain names on your tenants. Learn more.

Failed to connect the exchange Server using the UPN account [email address]. Value cannot be null. Parameter name: uriString

When configuring a connection to your target Exchange server, you may get this error if the program cannot find the admin's email address based on the provided UPN. To fix the problem, go back to the Server connection step, select the Connect to a specific server option, and type the server's FQDN manually. Double check also that the UPN is correct in the Admin account step, especially if entered manually, and continue with the server connection wizard.

Error: (407) Proxy Authentication Required.

Read more about this error in this Knowledge Base article.

Was this information useful?