Web Services InternalURL powershell configuration

If you are using a loadbalancer in front of the ClientAccess server or want to reconfigure the internal URL to point to http and not https you need to reconfigure a couple of services with the correct url so that autodiscover functions properly. To do so I have created a simple script to ease the process using powershell. The script does the following:

  • The server path is specified in the variable
  • Then we use -identity * if you have more than one instance you need to specifiy wich instance you want to configure
  • The url is generated using the variable and the default location of the services files
  • After reconfiguring the services we do a test of the connectivity to verify the configuration
  • Note that custom user credentials is used so that default credentials is not nessesary
  • OWA internal url has to be set manually

To run the script do the following:

  • Copy this into a txt file and rename it to a ps1 file
  • Navigate to the location where the file is saved
  • Use tab to get the correct run syntax

NOTE: This script has been updated in a post related to Exchange 2010 here: https://msunified.net/2010/01/13/configure-exchange-2010-internalurl-powershell-script/

$urlpath = "http://exchange-server.yourdomain.com"

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-ActiveSyncVirtualDirectory -Identity * -InternalUrl "$urlpath/Microsoft-Server-ActiveSync"

Test-WebServicesConnectivity -MailboxCredential (Get-Credential <Netbios domain name>\<username>) -TrustAnySSLCertificate
Test-activesyncConnectivity -MailboxCredential (Get-Credential <Netbios domain name>\<username>) -TrustAnySSLCertificate

3 thoughts on “Web Services InternalURL powershell configuration

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.