In the same way, you can reset and recreate all virtual directories (OAB, EWS, and Autodiscover) on Exchange 2019/2016/2013. Verify that all the Exchange virtual directories you re-created earlier are now displayed in the EAC console. In the Select Server field, select the name of the Exchange host on which you recreated the virtual directories. Select Servers item in the left pane and click Virtual Directories in the top menu.
Now open the browser and login to the Exchange Admin Center (EAC) using the link. Restart IIS or reboot the Exchange Server host. New-WebServicesVirtualDirectory -Server "ex2016" -InternalUrl "" -ExternalUrl "" New-PowerShellVirtualDirectory -Server "ex2016" -Name Powershell -InternalUrl -ExternalUrl -RequireSSL:$false New-OabVirtualDirectory -Server "ex2016" -InternalUrl "" -ExternalUrl ""
New-MapiVirtualDirectory -Server "ex2016" -InternalUrl -ExternalUrl -IISAuthenticationMethods Ntlm, OAuth, Negotiate Set-ClientAccessServer -Identity "ex2016" -AutodiscoverServiceInternalUri New-AutodiscoverVirtualDirectory -Server "ex2016" -BasicAuthentication $true -WindowsAuthentication $true To create these Exchange virtual directories, use: New-ActiveSyncVirtualDirectory -Server "ex2016" -InternalUrl "" -ExternalUrl "" The following table lists the default IIS authentication methods that are enabled by default for various Exchange virtual directories: Virtual directory Remove-WebServicesVirtualDirectory -Identity "ex2016\EWS (Default Web Site)" -Confirm:$True Remove-PowerShellVirtualDirectory -Identity "ex2016\PowerShell (Default Web Site)" Remove-AutodiscoverVirtualDirectory -Identity "ex2016\Autodiscover (Default Web Site)" Remove-MapiVirtualDirectory -Identity "ex2016\mapi (Default Web Site)" Remove-OabVirtualDirectory -Identity "ex2016\OAB (Default Web Site)" The following cmdlets are used to remove these Exchange virtual directories: Remove-ActiveSyncVirtualDirectory -Identity "ex2016\Microsoft-Server-ActiveSync (Default Web Site)" You can get info about other Exchange virtual directories by using the EMS cmdlets: Get-AutodiscoverVirtualDirectory Problems with them happen less often, but in some cases, you will also have to recreate them from scratch. However, there are several service virtual directories in Exchange. These Exchange virtual directories cause problems most often.
We have previously covered how to repair OWA and ECP virtual directories. New-WebApplication -Site "Exchange Back End" -Name ecp -PhysicalPath "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp" -ApplicationPool MSExchangeECPAppPool Rebuilding Other Exchange Virtual Directories using PowerShell New-WebApplication -Site "Exchange Back End" -Name owa -PhysicalPath "C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\owa" -ApplicationPool MSExchangeOWAAppPool Remove-WebApplication -Site "Exchange Back End" -Name 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 New-EcpVirtualDirectory -InternalUrl “” -ExternalUrl “”
Remove-EcpVirtualDirectory -Identity “ex2016\ecp (Default Web Site)”