Tame Those Pesky Exchange URLs

Now most people don’t build a new Exchange server everyday, every week or even every month. However, as an IT consultant I am constantly build, trashing and rebuilding labs with Exchange 2007, 2010 and 2013. Every time I build a new server I need to set the URLs to the environment that I am building. Not quite your typical situation for most people. I decided to create a script (yes, a script!) to help with this task. So what do we need to set in an Exchange environment? What virtual directories do Outlook, OWA and smartphones need in order to use Exchange properly?

Offline Address Book (OAB)

Web Services (EWS)

Active Sync (EAS)

Outlook Web Access (OWA)

AutoDiscoverServiceInternalUri – Setting on CAS defining AutoDiscover

So how do we set all of these in a programmatic manner? Well, let’s look at my simple script:

Note the script is short and simple. You may have to make adjustments as I have not coded the script to determine if you are running Exchange 2007, 2010 pr 2013. Also note that you can make the change for one server or multiple servers, it is up to you.

Lastly, this script changes the URLs for internal and external settings. Make sure this is what you want to do. If you need to configure a separate namespace, setup a second variable for this like $fdqn2 and then plug that into either the internal or external URL, depending on what you want to do with it.

Download the script from here:Set-ExchangeURLs**
** Don’t forget to rename the file to .ps1.