When you have a CAS load balance and use a virtual name to access its virtual directories, e.g. https://webmail.yourdomain.com/owa rather than the server name, you have to configure the internalURL and externalURL of all virtual directories. The problem occours if you change them through EMC, doing so you'll miss some virtual directories that can be managed only through EMS. EWS (Exchange Web Services) is one of these virtual directories and it's responsible for OOF.
To configure the proper URL for EWS run the following commands on EWS:
Set-webservicesvirtualdirectory –Identity
In order to configure all virtual directories' URL there is a script to help changing all virtual directories.
#ChangeAutodiscoverPath.ps1
#Changing InternalURL Path
$urlpath = Read-Host "Type Internal Client Access FQDN starting with http:// or https://"
Set-AutodiscoverVirtualDirectory -Identity * –internalurl “$urlpath/autodiscover/autodiscover.xml”
Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml”
Set-webservicesvirtualdirectory -Identity * –internalurl “$urlpath/ews/exchange.asmx”
Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab”
Set-owavirtualdirectory –Identity * –internalurl “$urlpath/owa”
Set-ecpvirtualdirectory –Identity * –internalurl “$urlpath/ecp”
Set-ActiveSyncVirtualDirectory -Identity * -InternalUrl "$urlpath/Microsoft-Server-ActiveSync"
#Changing ExternalURL Path
$urlpath2 = Read-Host "Type External Client Access FQDN starting with http:// or https://"
Set-AutodiscoverVirtualDirectory -Identity * –externalurl “$urlpath2/autodiscover/autodiscover.xml”
Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath2/autodiscover/autodiscover.xml”
Set-webservicesvirtualdirectory –Identity * –externalurl “$urlpath2/ews/exchange.asmx”
Set-oabvirtualdirectory –Identity * –externalurl “$urlpath2/oab”
Set-owavirtualdirectory –Identity * –externalurl “$urlpath2/owa”
Set-ecpvirtualdirectory –Identity * –externalurl “$urlpath2/ecp”
Set-ActiveSyncVirtualDirectory -Identity * -ExternalUrl "$urlpath2/Microsoft-Server-ActiveSync"
#get commands to doublecheck the config
get-AutodiscoverVirtualDirectory | fl identity,internalurl, externalurl
get-ClientAccessServer | fl identity,AutodiscoverServiceInternalUri
get-webservicesvirtualdirectory | fl identity,internalurl,externalurl
get-oabvirtualdirectory | fl identity,internalurl,externalurl
get-owavirtualdirectory | fl identity,internalurl,externalurl
get-ecpvirtualdirectory | fl identity,internalurl,externalurl
get-ActiveSyncVirtualDirectory | fl identity,internalurl,externalurl
Outlook uses the Internet Explorer proxy configuration to access any Exchange web service, such as OAB, Autodiscover and EWS, so make sure the internal Client Access FQDN is in the proxy exception list.