Set Exchange 2010 and 2013 Internal and External Virtual Directory URLs in PowerShell 6


Post to Twitter Post to Facebook Post to StumbleUpon

Original Posted Here:  MPECS Inc. Blog: Set Exchange 2010 and 2013 Internal and External Virtual Directory URLs in PowerShell

Here are the elevated PowerShell commands to run to set the virtual directory URLs

Get-ActiveSyncVirtualDirectory -server EXCHANGE | Set-ActiveSyncVirtualDirectory -ExternalUrl ‘https://mail.DOMAIN.ca/Microsoft-Server-ActiveSync’ -InternalUrl ‘https://mail.DOMAIN.ca/Microsoft-Server-ActiveSync’
Get-AutodiscoverVirtualDirectory -server EXCHANGE | Set-AutodiscoverVirtualDirectory -ExternalUrl ‘https://mail.DOMAIN.ca/Autodiscover/Autodiscover.xml’ -InternalUrl ‘https://mail.DOMAIN.ca/Autodiscover/Autodiscover.xml’
Get-ECPVirtualDirectory -server EXCHANGE | Set-ECPVirtualDirectory -ExternalUrl ‘https://mail.DOMAIN.ca/ECP’ -InternalUrl ‘https://mail.DOMAIN.ca/ECP’
Get-OabVirtualDirectory -server EXCHANGE | Set-OabVirtualDirectory -ExternalUrl ‘https://mail.DOMAIN.ca/OAB’ -InternalUrl ‘https://mail.DOMAIN.ca/OAB’
Get-WebServicesVirtualDirectory -server EXCHANGE | Set-WebServicesVirtualDirectory -ExternalUrl ‘https://mail.DOMAIN.ca/EWS/Exchange.asmx’ -InternalUrl ‘https://mail.DOMAIN.ca/EWS/Exchange.asmx’
The elevated PowerShell commands to verify the settings:

Get-ActiveSyncVirtualDirectory | fl internalurl,externalurl
Get-AutoDiscoverVirtualDirectory | fl internalurl,externalurl
Get-ECPVirtualDirectory | fl internalurl,externalurl
Get-OabVirtualDirectory | fl internalurl,externalurl
Get-WebServicesVirtualDirectory | fl internalurl,externalurl
Please note that we run a split DNS setup to have the external URL map to an internal IP address while folks are in the office (as per SBS STD).

UPDATE 2014-02-14: Apparently my eyes were crossed when copying and pasting the above commands. Corrections have been made on the Get – Set commands. :)

Thanks to Dave Shackelford who originally brought up the mistakes. :)

Philip Elder
Microsoft Cluster MVP
MPECS Inc.
Co-Author: SBS 2008 Blueprint Book

Chef de partie in the SMBKitchen
Find out more at
Third Tier: Enterprise Solutions for Small Business


Leave a comment

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.

6 thoughts on “Set Exchange 2010 and 2013 Internal and External Virtual Directory URLs in PowerShell