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 ‘’ -InternalUrl ‘’
Get-AutodiscoverVirtualDirectory -server EXCHANGE | Set-AutodiscoverVirtualDirectory -ExternalUrl ‘’ -InternalUrl ‘’
Get-ECPVirtualDirectory -server EXCHANGE | Set-ECPVirtualDirectory -ExternalUrl ‘’ -InternalUrl ‘’
Get-OabVirtualDirectory -server EXCHANGE | Set-OabVirtualDirectory -ExternalUrl ‘’ -InternalUrl ‘’
Get-WebServicesVirtualDirectory -server EXCHANGE | Set-WebServicesVirtualDirectory -ExternalUrl ‘’ -InternalUrl ‘’
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).

Originally posted in 2014 this popular post was migrated over from our previous blog

Make your IT business better than the competition. Help for IT Pros, TechYourBooks, Super Secret News, Women in IT Scholarship program, Ransomware Prevention Kit, 365 Security kit and more.

Leave a comment

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

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