Recreate ActiveSync Virtual Directory in Exchange 2013, 2016 and 2019

Recreate ActiveSync Virtual Directory in Exchange 2013, 2016 and 2019 (Default Web Site) and (Exchange Back End)

This article describes how to recreate the Activesync virtual directory on Exchange Server 2013, Exchange Server 2016 and Exchange Server 2019. Recreating these virtual directories helps to reset all settings. It can solve many problems relating to incorrect operation of smartphone ActiveSync access: various mobile outlook errors, permission problems, Outlook connectivity issues etc.

Note that the virtual directories are required to access Exchange services from web-based applications (such as Outlook Web App (OWA), Exchange Active Sync, Autodiscover). You can manage them in 3 places: EAC, EMS & IIS Manager.

In Exchange 2013, the Mailbox and Client Access roles can be installed on separate servers. Therefore, on the Mailbox server, virtual directories are located on the ExchangeBackEnd site (listening TCP ports 81, 444). In contrast, on the CAS server, the virtual directories are found on the DefaultWebSite site (listening TCP ports 80, 443).

In Exchange 2016, the Mailbox and Client Access roles are consolidated (separated CAS role was eliminated). Therefore, on the Mailbox server, virtual directories are located on the same server in these two sites:

The example above shows the Exchange 2016 Server with both the Default Web site and Exchange Back End 

Note: Run these commands in the servers where IIS sites are located.

Our tasks below are based on Exchange 2016, and we will be using the Exchange Management Shell.

To recreate the ActiveSync Virtual Directory in Exchange 2013, 2016, and 2019, follow these steps:

Remove-ActiveSyncVirtualDirectory -Identity "ServerName\Microsoft-Server-ActiveSync" 

Replace "ServerName" with the name of your Exchange server.

New-ActiveSyncVirtualDirectory -WebsiteName "Default Web Site" -ExternalUrl "https://mail.mitslab.com/Microsoft-Server-ActiveSync" 

Replace "mail.mistlab.com" with your Exchange server's external hostname.

Set-ActiveSyncVirtualDirectory -Identity "ServerName\Microsoft-Server-ActiveSync" -<SettingName> <SettingValue>

Replace "<SettingName>" with the name of the setting you want to configure (e.g., "ExternalAuthenticationMethods") and "<SettingValue>" with the value you want to set for that setting.

Get-ActiveSyncVirtualDirectory 

This should display the properties of the new ActiveSync Virtual Directory.

That's it! You have now recreated the ActiveSync Virtual Directory in Exchange 2013, 2016, and 2019.