3aIT Blog


So we hit an issue trying to change the autodiscover url in Exchange 2010 to enable our iPhone and Mac Mail users to have a nice easy setup since the client had changed their domain. After faffing about using the GUI and looking through IIS settings it was time to break out the command line.

Firstly I wanted to see what was set, in Exchange PowerShell type the following

Get-WebServicesVirtualDirectory |fl identity,internalurl,externalurl

This gives you the below output

Identity    : ESERVER01\EWS (Default Web Site)
InternalUrl : https://mail.olddomain.com/EWS/Exchange.asmx
ExternalUrl : https://mail.olddomain.com/ews/exchange.asmx

SO I needed to change both the URLS,

This was done buy running these commands,:

Set-WebServicesVirtualDirectory -Identity “ESERVER01\EWS (Default Web Site)” -InternalUrl https://mail.newdomain.com/EWS/Exchange.asmx -BasicAuthentication:$true

Set-WebServicesVirtualDirectory -Identity “ESERVER01\EWS (Default Web Site)” -ExternalUrl https://mail.newdomain.com/EWS/Exchange.asmx -BasicAuthentication:$true

Lastly we need to change the url for the Autodiscover.xml

Get-ClientAccessServer |fl identity,autodiscoverserviceinternaluri

The result is :-

Identity : ESERVER01
AutoDiscoverServiceInternalUri : https://mail.olddomain.com/Autodiscover/Autodiscover.xml

So we run :

Set-ClientAccessServer -Identity ESERVER01 –AutoDiscoverServiceInternalUri https://mail.newdomain.com/Autodiscover/Autodiscover.xml 

Then everything picked up the new settings and worked :)