Microsoft Exchange Server kurulumundan sonra yapılması gereken en kritik yapılandırmalardan biri,
Virtual Directory URL’lerinin ve Autodiscover SCP kaydının doğru ve tutarlı şekilde ayarlanmasıdır.

Varsayılan kurulumda Exchange:

  • Sunucu hostname’i
  • Random FQDN’ler
  • Eski domain kalıntıları

ile çalışabilir. Bu durum:

  • Outlook bağlantı problemleri
  • Sertifika uyarıları
  • Mobil cihaz senkronizasyon hataları
  • Autodiscover başarısızlıkları gibi sorunlara yol açar.

Bu makalemde Exchange Server üzerindeki tüm Virtual Directory’lerin ve Autodiscover SCP kaydının
tek bir standart domain altında (örnek: mail.kadirkozan.com.tr) nasıl yapılandırılacağı adım adım anlatılmaktadır.

Not:
mail.kadirkozan.com.tr yalnızca bir örnektir. Aynı adımlar eposta.domain.com, exchange.firma.local, mail.firma.gov.tr gibi tüm senaryolara birebir uygulanabilir.

a) Ön Gereksinimler

Yapılandırmaya başlamadan önce aşağıdaki şartlar sağlanmış olmalıdır:

1) DNS Gereksinimleri

  • Internal DNS
    • mail.kadirkozan.com.tr → Exchange Server IP
  • External DNS
    • mail.kadirkozan.com.tr → Public IP (NAT / Load Balancer)
  • Autodiscover DNS Kaydı
autodiscover.kadirkozan.com.tr → mail.kadirkozan.com.tr

2) SSL Sertifika Gereksinimleri

Kullanılacak sertifika SAN (Subject Alternative Name) içermelidir:

mail.kadirkozan.com.tr
autodiscover.kadirkozan.com.tr

Sertifikada tanımlı olmayan bir URL kullanılırsa Outlook ve mobil istemciler hata verir.

3) Yetkiler

  • Exchange Management Shell Administrator olarak çalıştırılmalıdır.
  • Hesap Organization Management yetkisine sahip olmalıdır.

b) Autodiscover SCP (Internal Service Connection Point)

Autodiscover SCP, domain üyesi Outlook istemcilerinin iç ağda ilk baktığı noktadır.

1 Yapılandırma

Get-ClientAccessService | Set-ClientAccessService `
-AutoDiscoverServiceInternalUri https://mail.kadirkozan.com.tr/Autodiscover/Autodiscover.xml

2) Kontrol

Get-ClientAccessService | fl Name,AutoDiscoverServiceInternalUri

c) Exchange Virtual Directory Yapılandırmaları

Bu bölümde Exchange üzerindeki tüm istemci erişim servisleri tek tek yapılandırılmaktadır.

1) Exchange Control Panel (ECP)

Get-EcpVirtualDirectory | Set-EcpVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/ecp `
-ExternalUrl https://mail.kadirkozan.com.tr/ecp

2) Exchange Web Services (EWS)

Get-WebServicesVirtualDirectory | Set-WebServicesVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/EWS/Exchange.asmx `
-ExternalUrl https://mail.kadirkozan.com.tr/EWS/Exchange.asmx

3) MAPI (Outlook Bağlantıları)

Get-MapiVirtualDirectory | Set-MapiVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/mapi `
-ExternalUrl https://mail.kadirkozan.com.tr/mapi

4) ActiveSync (Mobil Cihazlar)

Get-ActiveSyncVirtualDirectory | Set-ActiveSyncVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/Microsoft-Server-ActiveSync `
-ExternalUrl https://mail.kadirkozan.com.tr/Microsoft-Server-ActiveSync

5) Offline Address Book (OAB)

Get-OabVirtualDirectory | Set-OabVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/OAB `
-ExternalUrl https://mail.kadirkozan.com.tr/OAB

6) Outlook Web App (OWA)

Get-OwaVirtualDirectory | Set-OwaVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/owa `
-ExternalUrl https://mail.kadirkozan.com.tr/owa

7) PowerShell Virtual Directory

Get-PowerShellVirtualDirectory | Set-PowerShellVirtualDirectory `
-InternalUrl https://mail.kadirkozan.com.tr/powershell `
-ExternalUrl https://mail.kadirkozan.com.tr/powershell

d) Outlook Anywhere (RPC / MAPI over HTTP)

Outlook Anywhere, Outlook istemcilerinin Exchange’e bağlantı kurduğu ana bileşendir.

Get-OutlookAnywhere | Set-OutlookAnywhere `
-InternalHostname mail.kadirkozan.com.tr `
-ExternalHostname mail.kadirkozan.com.tr `
-InternalClientsRequireSsl $true `
-ExternalClientsRequireSsl $true `
-ExternalClientAuthenticationMethod Negotiate

Kontrol

Get-OutlookAnywhere | fl Server,InternalHostname,ExternalHostname

e) IIS Reset (Önerilen)

Tüm yapılandırmaların sorunsuz uygulanması için IIS reset yapılması önerilir:

iisreset

Genel Kontrol Komutu

Tüm Virtual Directory ayarlarını tek seferde kontrol etmek için:

Get-EcpVirtualDirectory |
Get-WebServicesVirtualDirectory |
Get-OwaVirtualDirectory |
Get-MapiVirtualDirectory |
Get-ActiveSyncVirtualDirectory |
Get-OabVirtualDirectory |
Get-PowerShellVirtualDirectory |
fl Name,InternalUrl,ExternalUrl
. 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'Connect-ExchangeServer -auto -ClientApplication:ManagementShell 

$yeni="EXC1"

Get-WebServicesVirtualDirectory -Server $yeni |Set-WebServicesVirtualDirectory -InternalUrl  https://mail.kadirkozan.com.tr/EWS/Exchange.asmx -ExternalUrl https://mail.kadirkozan.com.tr/EWS/Exchange.asmx

Set-ClientAccessService -Identity $yeni -AutoDiscoverServiceInternalUri "https://mail.kadirkozan.com.tr/Autodiscover/Autodiscover.xml"

Get-MapiVirtualDirectory -Server $yeni |Set-MapiVirtualDirectory -InternalUrl "https://mail.kadirkozan.com.tr/mapi" -ExternalUrl https://mail.kadirkozan.com.tr/mapi 

Get-OabVirtualDirectory -Server $yeni | Set-OabVirtualDirectory -InternalUrl https://mail.kadirkozan.com.tr/OAB -ExternalUrl  https://mail.kadirkozan.com.tr/OAB

Get-ActiveSyncVirtualDirectory -Server $yeni | Set-ActiveSyncVirtualDirectory -InternalUrl https://mail.kadirkozan.com.tr/Microsoft-Server-ActiveSync -ExternalUrl https://mail.kadirkozan.com.tr/Microsoft-Server-ActiveSync

Get-ECpVirtualDirectory -server $yeni | Set-EcpVirtualDirectory -InternalURL https://mail.kadirkozan.com.tr/ecp -ExternalURL https://mail.kadirkozan.com.tr/ecp

Get-owaVirtualDirectory -Server $yeni | Set-owaVirtualDirectory -InternalUrl https://mail.kadirkozan.com.tr/owa -ExternalUrl https://mail.kadirkozan.com.tr/owa 

Get-OutlookAnywhere -Server $yeni | Set-OutlookAnywhere -ExternalHostname "mail.kadirkozan.com.tr" -ExternalClientsRequireSsl:$true -InternalHostname "mail.kadirkozan.com.tr" -InternalClientsRequireSsl:$true -InternalClientAuthenticationMethod NTLM -ExternalClientAuthenticationMethod Negotiate