Verschieben von Exchange 2013 Protokolle von Standardordner mit Powershell

Verschieben von Exchange 2013 Protokolle von Standardordner mit Powershell

Wie Sie wissen, gibt es viele Arten von Exchange 2013-Protokolle und viel Speicherplatz verwendet wird - und - Platz auf Systemplatte. Theoretisch kann man Pfade aller Protokolle in Powershell ändern. Aber wegen der Anzahl der Protokolle Typen in Exchange, alle diese Ordner verwalten (und Dateigrößen, Verzeichnisgrößen, max Alter von Dateien) zu einem wahren Alptraum.

So habe ich für mich und dich ein wenig Notiz in Powershell -Skripts, so kann ich sie nach der Installation des nächsten neuen Server ausgeführt werden.

Protokolle für verschiedene Rollen in Exchange 2013

Wie Sie wissen, gibt es nur zwei Rollen in Exchange 2013: Client Access Server (CAS) und MailBox Server. Fast alle nützlichen Protokolle werden durch Transport Services generiert.

CAS haben nur einen Transportservice - FrontEnd Transport Service.

MailBox haben zwei:

  • TransportService
  • MailboxTransportService

Auch MailBox haben Assistenten (Assistants), die auch in den Protokollen erzeugenden beteiligt.

Also habe ich zwei Skripte erstellt. Erste - für CAS und das zweite für MailBox Server.

 

Verschieben von Protokollen auf Client Access Server in Exchange 2013

$exchangeservername = ""; # Servername
$MaxAge = 30; # Maximale Anzahl der Log-Dateien, die wir in Tagen zu halten, gehen
$MaxDirectorySize = "3 GB"; # Maximale Verzeichnisgröße für Log-Ordner
$MaxFileSize = "500 MB"; # Maximale Größe der einzelnen Protokolldatei

$FrontendTransportServiceBaseLogPath = "d:\exchange_logs\FrontendTransportService\"; # Basispfad Protokolle

Set-FrontendTransportService -Identity $exchangeservername `
	-AgentLogPath $($FrontendTransportServiceBaseLogPath + "AgentLog") `
	-AgentLogMaxAge $MaxAge `
	-AgentLogMaxDirectorySize $MaxDirectorySize `
	-AgentLogMaxFileSize $MaxFileSize `
	-ConnectivityLogPath $($FrontendTransportServiceBaseLogPath + "Connectivity") `
	-ConnectivityLogMaxAge $MaxAge `
	-ConnectivityLogMaxDirectorySize $MaxDirectorySize `
	-ConnectivityLogMaxFileSize $MaxFileSize `
	-ReceiveProtocolLogPath $($FrontendTransportServiceBaseLogPath + "ProtocolLog-SmtpReceive") `
	-ReceiveProtocolLogMaxAge $MaxAge `
	-ReceiveProtocolLogMaxDirectorySize $MaxDirectorySize `
	-ReceiveProtocolLogMaxFileSize $MaxFileSize `
	-SendProtocolLogPath $($FrontendTransportServiceBaseLogPath + "ProtocolLog-SmtpSend") `
	-SendProtocolLogMaxAge $MaxAge `
	-SendProtocolLogMaxDirectorySize $MaxDirectorySize `
	-SendProtocolLogMaxFileSize $MaxFileSize

Bitte beachten Sie Um einen Kommentar in scipt.

Nachdem das Skript ausgeführt wird, ist es besser, den Server neu zu starten.

Fortunatelly, gibt es keine Notwendigkeit, diese Verzeichnisse alle manuell zu erstellen - Austausch automatisch erstellt.

 

Moving logs on MailBox Server in Exchange 2013

$exchangeservername = ""; # Servername
$MaxAge = 30; # Maximale Anzahl der Log-Dateien, die wir in Tagen zu halten, gehen
$MaxDirectorySize = "3 GB"; # Maximale Verzeichnisgröße für Log-Ordner
$MaxFileSize = "500 MB"; # Maximale Größe der einzelnen Protokolldatei
 
$TransportServiceBaseLogPath = "d:\exchange_logs\TransportService\"; # Basispfad Protokolle
$MailboxServerBaseLogPath = "d:\exchange_logs\MailboxServer\"; # Basispfad Protokolle
$MailboxTransportServiceBaseLogPath = "d:\exchange_logs\MailboxTransportService\"; # Basispfad Protokolle
 
Set-TransportService -Identity $exchangeservername `
    -ConnectivityLogPath $($TransportServiceBaseLogPath + "Hub-Connectivity") `
    -ConnectivityLogMaxAge $MaxAge `
    -ConnectivityLogMaxDirectorySize $MaxDirectorySize `
    -ConnectivityLogMaxFileSize $MaxFileSize `
    -MessageTrackingLogPath $($TransportServiceBaseLogPath + "MessageTracking") `
    -MessageTrackingLogMaxAge $MaxAge `
    -MessageTrackingLogMaxDirectorySize $MaxDirectorySize `
    -MessageTrackingLogMaxFileSize $MaxFileSize `
    -IrmLogPath $($TransportServiceBaseLogPath + "IRMLogs") `
    -IrmLogMaxAge $MaxAge `
    -IrmLogMaxDirectorySize $MaxDirectorySize `
    -IrmLogMaxFileSize $MaxFileSize `
    -ActiveUserStatisticsLogPath $($TransportServiceBaseLogPath + "Hub-ActiveUsersStats") `
    -ActiveUserStatisticsLogMaxAge $MaxAge `
    -ActiveUserStatisticsLogMaxDirectorySize $MaxDirectorySize `
    -ActiveUserStatisticsLogMaxFileSize $MaxFileSize `
    -ServerStatisticsLogPath $($TransportServiceBaseLogPath + "Hub-ServerStats") `
    -ServerStatisticsLogMaxAge $MaxAge `
    -ServerStatisticsLogMaxDirectorySize $MaxDirectorySize `
    -ServerStatisticsLogMaxFileSize $MaxFileSize `
    -ReceiveProtocolLogPath $($TransportServiceBaseLogPath + "ProtocolLog-SmtpReceive") `
    -ReceiveProtocolLogMaxAge $MaxAge `
    -ReceiveProtocolLogMaxDirectorySize $MaxDirectorySize `
    -ReceiveProtocolLogMaxFileSize $MaxFileSize `
    -RoutingTableLogPath $($TransportServiceBaseLogPath + "Hub-Routing") `
    -RoutingTableLogMaxAge $MaxAge `
    -RoutingTableLogMaxDirectorySize $MaxDirectorySize `
    -SendProtocolLogPath $($TransportServiceBaseLogPath + "ProtocolLog-SmtpSend") `
    -SendProtocolLogMaxAge $MaxAge `
    -SendProtocolLogMaxDirectorySize $MaxDirectorySize `
    -SendProtocolLogMaxFileSize $MaxFileSize `
    -QueueLogPath $($TransportServiceBaseLogPath + "Hub-QueueViewer") `
    -QueueLogMaxAge $MaxAge `
    -QueueLogMaxDirectorySize $MaxDirectorySize `
    -QueueLogMaxFileSize $MaxFileSize `
    -WlmLogPath $($TransportServiceBaseLogPath + "Hub-WLM") `
    -WlmLogMaxAge $MaxAge `
    -WlmLogMaxDirectorySize $MaxDirectorySize `
    -WlmLogMaxFileSize $MaxFileSize `
    -PipelineTracingPath $($TransportServiceBaseLogPath + "Hub-PipelineTracing") `
    -AgentLogPath $($TransportServiceBaseLogPath + "Hub-AgentLog") `
    -AgentLogMaxAge $MaxAge `
    -AgentLogMaxDirectorySize $MaxDirectorySize `
    -AgentLogMaxFileSize $MaxFileSize
 
Set-MailboxServer -Identity $exchangeservername `
    -CalendarRepairLogPath $($MailboxServerBaseLogPath + "Calendar Repair Assistant") `
    -CalendarRepairLogFileAgeLimit $MaxAge `
    -CalendarRepairLogDirectorySizeLimit "2047 MB" `
    -MigrationLogFilePath  $($MailboxServerBaseLogPath + "Migration Assistant")
 
Set-MailboxTransportService -Identity $exchangeservername `
    -ConnectivityLogPath $($MailboxTransportServiceBaseLogPath + "Connectivity") `
    -ConnectivityLogMaxAge $MaxAge `
    -ConnectivityLogMaxDirectorySize $MaxDirectorySize `
    -ConnectivityLogMaxFileSize $MaxFileSize `
    -MailboxDeliveryAgentLogPath $($MailboxTransportServiceBaseLogPath + "AgentLog-Delivery") `
    -MailboxDeliveryAgentLogMaxAge $MaxAge `
    -MailboxDeliveryAgentLogMaxDirectorySize $MaxDirectorySize `
    -MailboxDeliveryAgentLogMaxFileSize $MaxFileSize `
    -MailboxSubmissionAgentLogPath $($MailboxTransportServiceBaseLogPath + "AgentLog-Submission") `
    -MailboxSubmissionAgentLogMaxAge $MaxAge `
    -MailboxSubmissionAgentLogMaxDirectorySize $MaxDirectorySize `
    -MailboxSubmissionAgentLogMaxFileSize $MaxFileSize `
    -ReceiveProtocolLogPath $($MailboxTransportServiceBaseLogPath + "ProtocolLog-SmtpReceive") `
    -ReceiveProtocolLogMaxAge $MaxAge `
    -ReceiveProtocolLogMaxDirectorySize $MaxDirectorySize `
    -ReceiveProtocolLogMaxFileSize $MaxFileSize `
    -SendProtocolLogPath $($MailboxTransportServiceBaseLogPath + "ProtocolLog-SmtpSend") `
    -SendProtocolLogMaxAge $MaxAge `
    -SendProtocolLogMaxDirectorySize $MaxDirectorySize `
    -SendProtocolLogMaxFileSize $MaxFileSize `
    -PipelineTracingPath $($MailboxTransportServiceBaseLogPath + "PipelineTracing")

Wie im vorherigen Fall, achten Sie auf Kommentare in Skript, und nach dem Laufen - den Server neu starten.

 

Löschen Exchange-Protokolle von Standardordner

Nachdem wir die Einstellungen der Protokollierung geändert haben, werden alte Protokolle auf ihren Plätzen sein, so müssen wir sie von uns selbst zu löschen. Ich habe ein Skript für diese zu Aktion.

rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\MessageTracking" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\IRMLogs" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ActiveUsersStats" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ServerStats" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Routing" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\QueueViewer" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\WLM" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\PipelineTracing" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\AgentLog" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\AgentLog" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Calendar Repair Assistant" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\Logging\Managed Folder Assistant" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\Connectivity" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Delivery" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Submission" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend" -force -rec
rmdir -path "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\PipelineTracing" -force -rec

 

skript, exchange (de), exchange 2013 (de)

  • Zugriffe: 3021
Kommentar schreiben

Related Articles