Windows by Patrik

Cleaning Up an Oversized ConfigurationStatus Folder

The ConfigurationStatus folder contains historical DSC execution information. When retention stops working correctly, the folder can grow to many gigabytes and contain thousands of old files.

Before deleting anything, stop the WinRM service and create a backup location:

Stop-Service WinRM

New-Item D:\DSCBackup -ItemType Directory

A practical approach is to remove status files older than 30 days:

Get-ChildItem "C:\Windows\System32\Configuration\ConfigurationStatus" |
    Where-Object LastWriteTime -lt (Get-Date).AddDays(-30) |
    Remove-Item -Force

This removes only historical status information and leaves recent records intact.

After the cleanup, verify whether DSC can read the remaining status information:

Get-DscConfigurationStatus | Select-Object StartDate,Type,Status

If DSC status retrieval works again, the problem was likely caused by old or corrupted status files.

If the same deserialization error continues to appear even after removing the historical data, the issue is likely deeper than the status history itself and may involve corrupted DSC state information or a failing DSC configuration.

Cleaning the folder reduces disk usage, but additional troubleshooting may still be necessary to restore full DSC functionality.

Cleanup
DSC
Maintenance
PowerShell
Storage

Comments