In small business support I don’t often find a need to use powershell but when I do it’s usually Exchange. I found myself troubleshooting a lack of Out of Office responses and a MAC that refused to connect to Exchange the other day. These powershell commands helped me determine where the problem was.
All three of these services require an autodiscover DNS record. So make sure that you have one. Our own Dave Shackelford wrote a very popular blog post on how to create one. You can read that post here. http://www.thirdtier.net/2011/06/setting-up-autodiscover-for-sbs-2011/
The first step is to determine if the services are configured for a URL that matches the SSL certificate.
Check the EWS URL
Powershell command to show the URL’s that EWS is configured to use.
Check and/or set the Internal autodiscover URL
1. Check the current configuration.
Get-ClientAccessServer | Select Name, *Internal* | fl
2. Define the new URL.
Set-ClientAccessServer –Identity <CAS Server Name> -AutoDiscoverServiceInternalUri: <Internal URL>
Verify that the OAB (Offline Address Book) has the correct URL
IF EWS Fails tests after verifying all settings above perform a reset of the Exchange virtual directories. This is found in the Exchange Management console under Server Configuration in the right side panel. After reset is compete run iisreset /noforce you may have to run it several times before it is successful.
This will result in the EWS directory being set to internal only.
You must then set the External URL
Powershell command to change the URL’s that EWS is configure to use.
Set-WebServicesVirtualDirectory –Identity “<EWS Name>” –ExternalUrl: https://url.domain.local/EWS/Exchange.asmx