This article describes how to remove an existing IIS virtual directories OWA and ECP on the Microsoft Exchange Server 2016 and create a new one. The rebuilding of these virtual directories helps to reset all settings, recreate them from the scratch and can solve many Exchange problems related to the incorrect operation of OWA or ECP: various page errors, blank screen issues, permission problems, missing files, Outlook connectivity issues etc.
Let us remind you, that the virtual directories required to access Exchange from a 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 2016 Mailbox and Client Access roles are consolidated (separate CAS role was eliminated). Therefore, on the Mailbox server virtual directories are located in 2 different sites:
- on a DefaultWebSite site (listening TCP ports 80, 443)
- on a ExchangeBackEnd site (listening TCP ports 81, 444)
Remove existing IIS virtual directories OWA and ECP and create a new one
OWA and ECP virtual directories in the IIS Manager console look like this:
You need to determine full name of the virtual directory on which the problems observed. To do this, start the Exchange Management Shell console and display a list of all OWA folders in the Exchange organization:
In our example, the name of the directory – owa (Default Web Site):
The same for ECP directory:
We are interested in the directory ecp (Default Web Site) on the server named EX2016.
Display and remember the virtual directory setting (ExternalURL, InternalURL, authentication settings):
Get-OwaVirtualDirectory “ex2016\owa (Default Web Site)”|select-object InternalUrl, ExternalUrl, BasicAuthentication,WindowsAuthentication,DigestAuthentication, FormsAuthentication Get-EcpVirtualDirectory “ex2016\ecp (Default Web Site)”|select-object InternalUrl, ExternalUrl, BasicAuthentication,WindowsAuthentication,DigestAuthentication, FormsAuthentication
Delete the OWA directory on the server ex2016:
Remove-OwaVirtualDirectory “ex2016\owa (Default Web Site)”
Create a new OWA directory:
New-OwaVirtualDirectory -InternalUrl “https://mail.contoso.local/owa” -ExternalUrl “https://mail.contoso.local/owa”
Now delete and re-create the directory ECP in similar way:
Remove-EcpVirtualDirectory -Identity “ex2016\ecp (Default Web Site)” New-EcpVirtualDirectory -InternalUrl “https://mail.contoso.local/ecp” -ExternalUrl “https://mail.contoso.local/ecp”
In some cases it is also useful to recreate OWA and ECP on the Exchange Back End site:
remove-WebApplication -Site "Exchange Back End" -Name owa remove-WebApplication -Site "Exchange Back End" -Name ecp New-WebApplication -Site "Exchange Back End" -Name owa -PhysicalPath "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\owa" -ApplicationPool MSExchangeOWAAppPool New-WebApplication -Site "Exchange Back End" -Name ecp -PhysicalPath "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp" -ApplicationPool MSExchangeECPAppPool
In the same way you can reset all other IIS directories on Exchange 2016, for example OAB, EWS and Autodiscover.