{"id":251,"date":"2015-04-28T10:07:53","date_gmt":"2015-04-28T08:07:53","guid":{"rendered":"http:\/\/www.michael.tassati.at\/?p=251"},"modified":"2015-11-11T09:14:13","modified_gmt":"2015-11-11T08:14:13","slug":"log-rollover-for-exchange-2013-server","status":"publish","type":"post","link":"https:\/\/www.michael.tassati.at\/?p=251","title":{"rendered":"log rollover for Exchange 2013 server"},"content":{"rendered":"<p>use forfiles (or something like that) for log rollover of Exchange Server to free up disk space &#8211; implement it for following folders<\/p>\n<p>C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Bin\\Search\\Ceres\\Diagnostics\\ETLTraces<br \/>\nC:\\Program Files\\Microsoft\\Exchange Server\\V15\\Bin\\Search\\Ceres\\Diagnostics\\Logs<br \/>\nC:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging<br \/>\nC:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging\\Diagnostics\\PerformanceLogsToBeProcessed<br \/>\nC:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging\\Monitoring\\Monitoring\\MSExchangeHMWorker\\ActiveMonitoringTraceLogs<br \/>\nC:\\Program Files\\Microsoft\\Exchange Server\\V15\\TransportRoles\\data\\Temp<br \/>\nC:\\inetpub\\logs<\/p>\n<p>exp: forfiles \/p C:\\inetpub\\logs \/m *.log \/s \/d -10 \/c &#8222;cmd \/c DEL @path&#8220;<\/p>\n<p>alternativ with Powershell:<\/p>\n<p><span style=\"color: #00008b; font-family: Lucida Console; font-size: xx-small;\">Function<\/span> <span style=\"color: #8a2be2; font-family: Lucida Console; font-size: xx-small;\">Remove-ToolsLog<\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\">(<\/span><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$olderThenDays<\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\">){<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Set-ToolsLogAddLine<\/span><\/span><\/span> <span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\">-LogTXT<\/span><\/span><\/span> <span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\">&#8222;Remove old log files&#8220;<\/span><\/span><\/span> <span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\">-Foregroundcolor<\/span><\/span><\/span> <span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\">&#8222;green&#8220;<\/span><\/span><\/span><\/p>\n<p><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$logPath<\/span><\/span><\/span> <span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">=<\/span><\/span><\/span> <span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Split-Path<\/span><\/span><\/span> <span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$Script:LogFilePath<\/span><\/span><\/span> <span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\">-Parent<\/span><\/span><\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Get-ChildItem<\/span><\/span><\/span> <span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\">-path<\/span><\/span><\/span> <span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$logPath<\/span><\/span><\/span> <span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">|<\/span><\/span><\/span> <span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Where-Object<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\"> { <\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">!<\/span><\/span><\/span><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$_<\/span><\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">.<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">PSIsContainer <\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">-and<\/span><\/span><\/span> <span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$_<\/span><\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">.<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">Extension <\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">-eq<\/span><\/span><\/span> <span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #8b0000; font-family: Lucida Console; font-size: xx-small;\">&#8222;.log&#8220;<\/span><\/span><\/span> <span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">-and<\/span><\/span><\/span> <span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$_<\/span><\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">.<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">CreationTime <\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">-lt<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\"> (<\/span><\/span><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Get-Date<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">)<\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">.<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">AddDays(<\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">&#8211;<\/span><\/span><\/span><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #ff4500; font-family: Lucida Console; font-size: xx-small;\">$olderThenDays<\/span><\/span><\/span><span style=\"font-family: Lucida Console; font-size: xx-small;\"><span style=\"font-family: Lucida Console; font-size: xx-small;\">) } <\/span><\/span><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #a9a9a9; font-family: Lucida Console; font-size: xx-small;\">|<\/span><\/span><\/span> <span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #0000ff; font-family: Lucida Console; font-size: xx-small;\">Remove-Item<\/span><\/span><\/span> <span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\"><span style=\"color: #000080; font-family: Lucida Console; font-size: xx-small;\">-Force<\/span><\/span><\/span><\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>use forfiles (or something like that) for log rollover of Exchange Server to free up disk space &#8211; implement it for following folders C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Bin\\Search\\Ceres\\Diagnostics\\ETLTraces C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Bin\\Search\\Ceres\\Diagnostics\\Logs C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging\\Diagnostics\\PerformanceLogsToBeProcessed C:\\Program Files\\Microsoft\\Exchange Server\\V15\\Logging\\Monitoring\\Monitoring\\MSExchangeHMWorker\\ActiveMonitoringTraceLogs C:\\Program Files\\Microsoft\\Exchange Server\\V15\\TransportRoles\\data\\Temp C:\\inetpub\\logs exp: forfiles \/p C:\\inetpub\\logs \/m *.log \/s \/d -10 \/c &#8222;cmd \/c DEL &hellip; <a href=\"https:\/\/www.michael.tassati.at\/?p=251\" class=\"more-link\"><span class=\"screen-reader-text\">log rollover for Exchange 2013 server<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,7],"tags":[69,12,71,74,64],"_links":{"self":[{"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/posts\/251"}],"collection":[{"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=251"}],"version-history":[{"count":4,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions\/365"}],"wp:attachment":[{"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.michael.tassati.at\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}