You may notice that your Skype for Business Front End server consumes a lot of disk space and the culprit will either be:
C:\ProgramData\Windows Fabric\Log (SfB 2015)
or
C:\ProgramData\Microsoft\SF\Log (SfB 2019)
This is caused by Windows Fabric log growth and can be rectified by either:
1) Increase disk space
2) Limit how long Fabric Logs are kept (default 3 days)
This post shows how to do option 2 manually in SfB 2015: https://myhybridsetup.org/skype-for-business-2015-limit-fabric-tracing-logs-growth/
The post above is still valid for SfB 2019, except the ‘ClusterManifest.Xml.Template’ is in a slightly different path: C:\Program Files\Skype for Business Server 2019\Server\Core (Quite obvious) and the Fabric Logs have moved to: C:\ProgramData\Microsoft\SF\Log
You can implement the same fix manually, or I have a script a colleague created to do this for you.
Disclaimer: Do not run this on a prod environment without first testing yourself.
$ver = Get-CsServerVersion
# Get Fabric Template Config files
$file = “C:\Program Files\Skype for Business Server $($ver.Substring(26,4))\Server\Core\ClusterManifest.Xml.Template"
# Copy and rename files incase of issues
Copy-Item -Path $file -Destination “$($file).old"
# Replace 3days with 1 day
(Get-Content $file)|foreach {$_ -Replace 'Name="DataDeletionAgeInDays" Value="3"','Name="DataDeletionAgeInDays" Value="1"'}|out-file $file -Force
# Delete logs SfB 2015
If (test-path -Path "C:\ProgramData\Windows Fabric\Log" -ErrorAction SilentlyContinue){Get-ChildItem "C:\ProgramData\Windows Fabric\Log"-Recurse |where {$_.name -like "*.etl" -or $_.name -like "*.blg"}|Remove-Item -Force -ErrorAction SilentlyContinue}
# Delete logs SfB 2019
elseif (Test-Path -Path "C:\ProgramData\Microsoft\SF\Log" -ErrorAction SilentlyContinue){ Get-ChildItem "C:\ProgramData\Microsoft\SF\Log" -Recurse |where {$_.name -like "*.etl" -or $_.name -like "*.blg"}|Remove-Item -Force -ErrorAction SilentlyContinue}
Write-Host "Restart Front End Services Manually" -ForegroundColor Yellow
The script is doing a couple of things:
- Get SfB Version to work out where ClusterManifest.xml.Template file & Fabric Logs may be (Assumes SfB has been installed on the C: drive!)
- Take a backup of ClusterManifest.xml.Template
- Perform a find and replace in ClusterManifest.xml.Template to set DataDeletionAgeInDays to 1 rather than 3
- Delete all SfB 2015 Fabric Logs
- Delete all SfB 2019 Fabric Logs
- Prompt you to restart Front End services
When we deploy SfB, we run this script on all servers on an FE pool to keep Fabric Logs/Traces to a minimum.
WARNING – It’s not clear if this is supported by Microsoft or whether future updates/CUs overwrite ClusterManifest.Xml.Template.
Technical Architect at Symity
If you’re cleaning out the logs, it’s also worth cleaning out the archived perfmon data located here.
C:\ProgramData\Microsoft\SF\Log\PerformanceCounters_WindowsFabricPerfCounter
C:\ProgramData\Microsoft\SF\Log\PerformanceCountersBinaryArchive
More info: https://www.ucmadscientist.com/fabric-circular-logging-for-skype-for-business-2019/
Thanks for the script!
Should note when outputting the new Template file, it changes the original file encoding. Original file encoding is ANSI.
To keep this, should add “-Encoding Ascii” to “-out-file” command.