In exchange powershell :

# Configure Virtual Directories for the “Default Web Site”

Set-WebServicesVirtualDirectory -Identity Exch2007\"EWS (Default Web Site)" -InternalUrl https://exch2007.yourdomain.com/ews/exchange.asmx -ExternalUrl https://exch2007.yourdomain.com/ews/exchange.asmx
Set-OabVirtualDirectory -Identity Exch2007\"OAB (Default Web Site)" -InternalUrl https://exch2007.yourdomain.com/OAB -ExternalUrl https://exch2007.yourdomain.com/OAB -RequireSSL:$True
Set-UMVirtualDirectory -Identity Exch2007\"UnifiedMessaging (Default Web Site)" -InternalUrl https://exch2007.yourdomain.com/unifiedmessaging/service.asmx -ExternalUrl https://exch2007.yourdomain.com/unifiedmessaging/service.asmx
Set-OWAVirtualDirectory -Identity Exch2007\"OWA (Default Web Site)" -InternalURL https://exch2007.yourdomain.com/owa -ExternalUrl https://yourdomain.com/owa -LogonFormat username -DefaultDomain internaldomain.com
# Set URL for AutoDiscover
Set-ClientAccessServer -Identity Exch2007 -AutodiscoverServiceInternalURI https://exch2007.yourdomain.com/autodiscover/autodiscover.xml -AutodiscoverSiteScope:$null
Set-AutoDiscoverVirtualDirectory -identity Exch2007\"Autodiscover (Default Web Site)" -InternalUrl https://exch2007.yourdomain.com/autodiscover/autodisover.xml -ExternalUrl https://exch2007.yourdomain.com/autodiscover/autodisover.xml
# Reset IIS
IISRESET -NoForce

Ref : http://www.msexchange.org/articles-tutorials/exchange-server-2007/migration-deployment/exchange-2007-install-configuration-command-line-part2.html
Tagged with:  

I didn’t do this script, i’ve just adapt it to the way we work :http://jaworskiblog.com/2013/04/13/setting-internal-and-external-urls-in-exchange-2013/

I’ve simplify a lot the original script to make this beauty, the only thing remaining is to fill the 3 variables at the start :


$InternalName = "myOwaURL.publicInternetDomain.com"
$ExternalName = $InternalName
$ExServer = "ServerNameHere"

Get-WebservicesVirtualDirectory -Server $ExServer | Set-WebservicesVirtualDirectory -InternalURL https://$InternalName/EWS/Exchange.asmx -ExternalURL https://$externalName/EWS/Exchange.asmx
Get-OwaVirtualDirectory -Server $ExServer | Set-OwaVirtualDirectory -InternalURL https://$InternalName/owa -ExternalURL https://$ExternalName/owa
Get-ecpVirtualDirectory -Server $ExServer | Set-ecpVirtualDirectory -InternalURL https://$InternalName/ecp -ExternalURL https://$ExternalName/ecp
Get-ActiveSyncVirtualDirectory -Server $ExServer | Set-ActiveSyncVirtualDirectory -InternalURL https://$InternalName/Microsoft-Server-ActiveSync -ExternalURL https://$ExternalName/Microsoft-Server-ActiveSync
Get-OABVirtualDirectory -Server $ExServer | Set-OABVirtualDirectory -InternalUrl https://$InternalName/OAB -ExternalURL https://$ExternalName/OAB
Set-ClientAccessServer $ExServer -AutodiscoverServiceInternalUri https://$internalName/Autodiscover/Autodiscover.xml
Set-OutlookAnywhere -Identity “$ExServer\Rpc (Default Web Site)” -InternalHostname $internalName -ExternalHostName $ExternalName -InternalClientAuthenticationMethod ntlm -InternalClientsRequireSsl:$True -ExternalClientAuthenticationMethod Basic -ExternalClientsRequireSsl:$True

Write-Host “Vdirs have been set to the following..” -Foregroundcolor Green
Write-Host “$ExServer EWS”
Get-WebservicesVirtualDirectory -Server $ExServer |Fl internalURL,ExternalURL
Write-Host “$ExServer OWA”
Get-OWAVirtualDirectory -Server $ExServer | Fl internalUrl,ExternalURL
Write-Host “$ExServer ECP”
Get-ECPVirtualDirectory -Server $ExServer | Fl InternalURL,ExternalURL
Write-Host “$ExServer ActiveSync”
Get-ActiveSyncVirtualDirectory -Server $ExServer | Fl InternalURL,ExternalURL
Write-Host “$ExServer OAB”
Get-OABVirtualDirectory -Server $ExServer | Fl InternalURL,ExternalURL
Write-Host “$ExServer Internal Autodiscover URL”
Get-ClientAccessServer $ExServer | Fl AutodiscoverServiceInternalUri
Write-Host “$Exserver Outlook Anywhere Settings”
Get-OutlookAnywhere -Identity “$ExServer\rpc (Default Web Site)” |fl internalhostname,internalclientauthenticationmethod,internalclientsrequiressl,externalhostname

As you can see, i’m using the same on the internal and external URL, the reason is simple, we hate working to much and using the same mean just one single certificate can do the job in and out !

Tagged with: