I have been assigned a task to fix the issue of ActiveSync where Users were able to access their emails on Mobile devices when they are on internal network as soon as they use internet to access the emails, it stopped working.
So as starting point of troubleshooting, I checked with Microsoft Remote Connectivity Analyzer and found the following error:
No external URL is available to access this mailbox with Exchange ActiveSync. Your Exchange server configuration needs to be changed to allow access.
This error is simply pointed to the external URL of the AutoDiscover virtual directory where the external URL was empty as expected.
Exchange Version: Exchange 2019 | Client Devices: iOS & Android
Solution 1: Add External AutoDiscover URL in Virtual Directory
You can run the following command on Exchange PowerShell to make it correct:
Set-ActiveSyncVirtualDirectory -Identity "ServerName\Microsoft-Server-ActiveSync (Default Web Site)" -ExternalUrl https://autodiscover.domain.com/Microsoft-Server-ActiveSync
You can check the status of the external URL with the following command:
Get-ActiveSyncVirtualDirectory | fl identity, InternalUrl, ExternalUrl
Don't forget to restart IIS services. You can test now, ActiveSync from Internet should work.
Solution 2: Edit web.config for ExternalProxy
If it still didn't work, we have to follow the below steps.
Access the location \\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Sync and find the web.config file. Please make a copy of web.config file as a backup in case we need to revert changes.
Open web.config file in Notepad and find the section <appSettings>.
You will add the below line in this section:
<add key="ExternalProxy" value=""></add>
Note: If you are copying from here then make sure that quotes are correct.
It should look like this:
<appSettings>
<add key="ExternalProxy" value=""></add>
<add key="UserWorkloadManager.PermitSynchronousTaskExecution" value="false" />
<!-- Config file for tracing -->
</appSettings>
Once again restart IIS services and run Microsoft Remote Connectivity Analyzer -- it should work fine now.
