xchange Server 2019 kurulumundan sonra, varsayılan olarak birçok log, izleme ve performans dosyası sistem diski (C:) altında tutulur. Üretim ortamlarında bu durum;
- Sistem diskinde hızlı dolma
- Performans düşüşleri
- Yedekleme ve bakım zorlukları
gibi sorunlara yol açabilir.
Bu nedenle Exchange loglarının ayrı bir disk (örneğin L:) üzerine taşınması, Microsoft’un da önerdiği en iyi uygulamalardan biridir.
Bu makalede, Exchange Server 2019 üzerinde Transport, FrontEnd, Mailbox, POP3, IMAP ve Performance Monitor loglarının PowerShell ile nasıl taşınacağı adım adım açıklanmaktadır.
Exchange Management Shell’e Bağlanma
Öncelikle Exchange PowerShell ortamını yükleyip sunucuya bağlanıyoruz:
.'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'
Connect-ExchangeServer -auto -ClientApplication:ManagementShell
Ardından, üzerinde işlem yapılacak Exchange sunucu adını değişkene atıyoruz:
$exchangeservername = $env:computername
Transport Service Loglarının Taşınması
Transport servisleri; SMTP, mesaj izleme (Message Tracking), kuyruk (Queue) ve protokol loglarını üretir. Bu logları L: diskine taşıyoruz:
Set-TransportService -Identity $exchangeservername `
-ConnectivityLogPath "L:\TransportRoles\Logs\Hub\Connectivity" `
-MessageTrackingLogPath "L:\TransportRoles\Logs\MessageTracking" `
-IrmLogPath "L:\Logging\IRMLogs" `
-ActiveUserStatisticsLogPath "L:\TransportRoles\Logs\Hub\ActiveUsersStats" `
-ServerStatisticsLogPath "L:\TransportRoles\Logs\Hub\ServerStats" `
-ReceiveProtocolLogPath "L:\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive" `
-RoutingTableLogPath "L:\TransportRoles\Logs\Hub\Routing" `
-SendProtocolLogPath "L:\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend" `
-QueueLogPath "L:\TransportRoles\Logs\Hub\QueueViewer" `
-WlmLogPath "L:\TransportRoles\Logs\Hub\WLM" `
-PipelineTracingPath "L:\TransportRoles\Logs\Hub\PipelineTracing" `
-AgentLogPath "L:\TransportRoles\Logs\Hub\AgentLog"
Performance Monitor (PerfMon) Loglarının Taşınması
Exchange, performans izleme için logman aracıyla otomatik çalışan PerfMon logları üretir. Bu logları da L: diskine yönlendiriyoruz.
Daily Performance Logs
logman -stop ExchangeDiagnosticsDailyPerformanceLog
logman -update ExchangeDiagnosticsDailyPerformanceLog `
-o "L:\Logging\Diagnostics\DailyPerformanceLogs\ExchangeDiagnosticsDailyPerformanceLog"
logman -start ExchangeDiagnosticsDailyPerformanceLog
Performance Logs to Be Processed
logman -stop ExchangeDiagnosticsPerformanceLog
logman -update ExchangeDiagnosticsPerformanceLog `
-o "L:\Logging\Diagnostics\PerformanceLogsToBeProcessed\ExchangeDiagnosticsPerformanceLog"
logman -start ExchangeDiagnosticsPerformanceLog
FrontEnd Transport Service Loglarının Taşınması
Client Access (SMTP FrontEnd) servislerinin logları aşağıdaki şekilde taşınır:
Set-FrontendTransportService -Identity $exchangeservername `
-AgentLogPath "L:\TransportRoles\Logs\FrontEnd\AgentLog" `
-ConnectivityLogPath "L:\TransportRoles\Logs\FrontEnd\Connectivity" `
-ReceiveProtocolLogPath "L:\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend"
IMAP Loglarının Taşınması
IMAP servisinin log dizini aşağıdaki komut ile değiştirilir:
Set-ImapSettings -LogFileLocation "L:\Logging\Imap4"
Mailbox Server Loglarının Taşınması
Mailbox sunucusuna ait yardımcı servis logları (Calendar Repair ve Migration) aşağıdaki şekilde taşınır:
Set-MailboxServer -Identity $exchangeservername `
-CalendarRepairLogPath "L:\Logging\Calendar Repair Assistant" `
-MigrationLogFilePath "L:\Logging\Managed Folder Assistant"
Mailbox Transport Service Loglarının Taşınması
Mailbox içi SMTP ve pipeline logları için:
Set-MailboxTransportService -Identity $exchangeservername `
-ConnectivityLogPath "L:\TransportRoles\Logs\Mailbox\Connectivity" `
-MailboxDeliveryAgentLogPath "L:\TransportRoles\Logs\Mailbox\AgentLog\Delivery" `
-MailboxSubmissionAgentLogPath "L:\TransportRoles\Logs\Mailbox\AgentLog\Submission" `
-ReceiveProtocolLogPath "L:\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend" `
-PipelineTracingPath "L:\TransportRoles\Logs\Mailbox\PipelineTracing"
POP3 Loglarının Taşınması
POP3 servis logları için:
Set-PopSettings -LogFileLocation "L:\Logging\Pop3"
Bu yapılandırma ile:
- Sistem diski (C:) üzerindeki yük azaltılır
- Exchange logları merkezi ve yönetilebilir hale gelir
- Performans ve disk yönetimi iyileştirilir
Öneriler
- L: diskinin NTFS, yeterli alan ve düzenli yedekleme politikasına sahip olduğundan emin olun
- Değişikliklerden sonra Exchange servislerini yeniden başlatmanız gerekebilir
- Log dizinlerinin otomatik oluşturulup oluşturulmadığını kontrol edin
. 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'
Connect-ExchangeServer -auto -ClientApplication:ManagementShell
$exchangeservername = $env:computername
Set-TransportService -Identity $exchangeservername -ConnectivityLogPath "L:\TransportRoles\Logs\Hub\Connectivity" -MessageTrackingLogPath "L:\TransportRoles\Logs\MessageTracking" -IrmLogPath "L:\Logging\IRMLogs" -ActiveUserStatisticsLogPath "L:\TransportRoles\Logs\Hub\ActiveUsersStats" -ServerStatisticsLogPath "L:\TransportRoles\Logs\Hub\ServerStats" -ReceiveProtocolLogPath "L:\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive" -RoutingTableLogPath "L:\TransportRoles\Logs\Hub\Routing" -SendProtocolLogPath "L:\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend" -QueueLogPath "L:\TransportRoles\Logs\Hub\QueueViewer" -WlmLogPath "L:\TransportRoles\Logs\Hub\WLM" -PipelineTracingPath "L:\TransportRoles\Logs\Hub\PipelineTracing" -AgentLogPath "L:\TransportRoles\Logs\Hub\AgentLog"
# move the path for the PERFMON logs from the C: drive to the E: drive
logman -stop ExchangeDiagnosticsDailyPerformanceLog
logman -update ExchangeDiagnosticsDailyPerformanceLog -o "L:\Logging\Diagnostics\DailyPerformanceLogs\ExchangeDiagnosticsDailyPerformanceLog"
logman -start ExchangeDiagnosticsDailyPerformanceLog
logman -stop ExchangeDiagnosticsPerformanceLog
logman -update ExchangeDiagnosticsPerformanceLog -o "L:\Logging\Diagnostics\PerformanceLogsToBeProcessed\ExchangeDiagnosticsPerformanceLog"
logman -start ExchangeDiagnosticsPerformanceLog
# Get the details on the EdgeSyncServiceConfig and store them in a variable for use in setting the path
$EdgeSyncServiceConfigVAR=Get-EdgeSyncServiceConfig
# Move the Log Path using the variable we got
# Move the standard log files for the FrontEndTransportService to the same path on the E: drive that they were on C:
Set-FrontendTransportService -Identity $exchangeservername -AgentLogPath "L:\TransportRoles\Logs\FrontEnd\AgentLog" `
-ConnectivityLogPath "L:\TransportRoles\Logs\FrontEnd\Connectivity" `
-ReceiveProtocolLogPath "L:\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend"
# MOve the log path for the IMAP server
Set-ImapSettings -LogFileLocation "L:\Logging\Imap4"
# Move the logs for the MailBoxServer
Set-MailboxServer -Identity $exchangeservername `
-CalendarRepairLogPath "L:\Logging\Calendar Repair Assistant" `
-MigrationLogFilePath "L:\Logging\Managed Folder Assistant"
# Move the standard log files for the MailboxTransportService to the same path on the E: drive that they were on C:
Set-MailboxTransportService -Identity $exchangeservername `
-ConnectivityLogPath "L:\TransportRoles\Logs\Mailbox\Connectivity" `
-MailboxDeliveryAgentLogPath "L:\TransportRoles\Logs\Mailbox\AgentLog\Delivery" `
-MailboxSubmissionAgentLogPath "L:\TransportRoles\Logs\Mailbox\AgentLog\Submission" `
-ReceiveProtocolLogPath "L:\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive" `
-SendProtocolLogPath "L:\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend" `
-PipelineTracingPath "L:\TransportRoles\Logs\Mailbox\PipelineTracing"
# MOve the log path for the POP3 server
Set-PopSettings -LogFileLocation "L:\Logging\Pop3"