Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Manage Exchange 2016 daily performance logs

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Recently, a friend sent me a screenshot of an error reported by Exchange. Recently, this mistake has been repeated over and over again, so let me take a look at it.

Through the error message in the screenshot, we can see that the folder 'DailyPerformanceLogs'' has reached the maximum set value. This error is because Exchange Diagnostic service thought there might be data loss, so he threw the error log.

At this point of analysis, we can think of two solutions:

Disable the check of Exchange Diagnostic service log so that it is no longer checked. (cure the symptoms but not the root of the problem)

Setting method: open C:\ Program Files\ Microsoft\ Exchange Server\ V15\ bin\ Microsoft.Exchange.Diagnostics.Service.exe.config using notepad

Under 'DailyPerformanceLogs', we need to put "LogDataLoss" = "False"

Assign a separate path with more space to the log

In the daily Exchange operation and maintenance, we may encounter the log to fill up the disk and cause system problems, in order to avoid this situation, we need to manage these log files. In general, some will use backup software / tools to back up the logs. In the absence of professional backup software, we can only clean up these files manually, which will be more painful.

Here's a script I wrote to put it in the task schedule, execute it regularly every day, and clean up the log from three days ago.

#-Daily Performance Logs-#

#-define parameters-#

#-get current date-#

$Now = Get-Date

#-define amount of days-#

$Days = "3"

#-define folder where files are located-#

$TargetFolder = "C:\ Program Files\ Microsoft\ Exchange Server\ V15\ Logging\ Diagnostics\ DailyPerformanceLogs"

#-define extension-#

$Extension = "* .blg"

#-define LastWriteTime parameter based on $Days-- #

$LastWrite = $Now.AddDays (- $Days)

$Files = Get-Childitem $TargetFolder-Include $Extension-Recurse | Where {$_ .LastWriteTime-le "$LastWrite"}

Remove-Item $Files

#-W3SVC1 Folder-#

#-define folder where files are located-#

$TargetFolder1 = "C:\ inetpub\ logs\ LogFiles\ W3SVC1"

#-define extension-#

$Extension1 = "* .log"

#-define LastWriteTime parameter based on $Days-- #

$LastWrite = $Now.AddDays (- $Days)

$Files1 = Get-Childitem $TargetFolder1-Include $Extension1-Recurse | Where {$_ .LastWriteTime-le "$LastWrite"}

Remove-Item $Files1

#-W3SVC2 Folder-#

#-define folder where files are located-#

$TargetFolder2 = "C:\ inetpub\ logs\ LogFiles\ W3SVC2"

#-define extension-#

$Extension2 = "* .log"

#-define LastWriteTime parameter based on $Days-- #

$LastWrite = $Now.AddDays (- $Days)

$Files2 = Get-Childitem $TargetFolder2-Include $Extension2-Recurse | Where {$_ .LastWriteTime-le "$LastWrite"}

Remove-Item $Files2

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report