Last update - 22.12.2015
Script was updated with corrected build numbers to work in native Exchange 2016 environment and change MAPI vdirs
Script was updated and verified with Exchange 2016.
I have modified questions to better differentiate OAB and powershell virtual directories.
I have also fixed some problems with Outlook Anywhere.
When you need to add another Exchange server to your environment or have to change hostname, used by virtual directories on Exchange servers there are quite a lot of cmdlets to set.
I made changes few times with script set-allvdirs.ps1, but lately I noticed that almost all sources of this script vanished. It is available on Nathan Winters personal blog, but have no idea how long.
I made some modifications and changes for my personal needs and updates for Exchange 2013 SP1. Script modifies all virtual directories, autodiscover SCP and Outlook Anywhere hostnames. You can choose if changes are made on all servers or local machine.