ConfigurationStatus folder filling up.

Hi ,

We have a 2016 server running , C:\Windows\System32\Configuration\ConfigurationStatus has over 75,000 files in it totaling about 80 GB. Is this folder supposed to be cleared out automatically by the DSC process or do we need to do that manually?

Is it safe to delete?

I am coming from the Linux world , our Windows guy in the hospital due the corona …

I don’t have any experience with this kind of things , also as i read this related to the WMF , again , never had experience with that.

 

Thanks

 

 

Supposed to be deleted yes, the LCM has a the retention period set but is not honoured (iirc).

Cleaning manually is fine, I usually clean things older than ~7 days.

Thanks for the quick answer, I will delete manually the files that older than 7 days.

Last question, What are these files used for?

 

 

 

Those files are the log created by the LCM to be sent to the report server.

They should be sent anyway if the report server is configured, and you can still access unstructured data in the event logs.

Ok, thank you very much!

 

I resolved this within my DSC configuration itself by adding a (slightly unortodox, but it works) Script resource to the configuration:

Import-DscResource -ModuleName PSDscResources
 
# Clean up DSC ConfigurationStatus folder to remove files older than 10 days - see https://forums.powershell.org/t/configurationstatus-folder-filling-up/14982, https://tickets.puppetlabs.com/browse/MODULES-4412
Script "CleanupDSCConfigurationStatus"
{
    GetScript = {@{Result = ''}}
    TestScript = 
    {
        $ConfigStatusFolder = "$env:SystemRoot\System32\Configuration\ConfigurationStatus\"
        $CreationDateLimit = (Get-Date).AddDays(-10)
        if (Test-Path $ConfigStatusFolder) {
            Get-ChildItem -Path "$ConfigStatusFolder*" -File -Include '*.details.json', '*.mof' | Where-Object { $_.CreationTime -le $CreationDateLimit } | Remove-Item -Force
            $true
        }
    }
    SetScript = {$null}
}

This performs a cleanup of any files older than 10 days (the default for StatusRetentionTimeInDays) at the end of each ‘test’ cycle and seems to work perfectly in our environment.