A (Windows 2016) server with a perfectly reasonable 200GB Windows partition was reporting as low on free disk space. Investigation showed that the \Windows\WinSxS folder contained over 80GB of data...
Laughably, Microsoft claim that the WinSxS folder is reduced in size automatically, but clearly this does not happen (presumably because the automated task times out before completion as the folder increases in size). The best method to reduce a large WinSxS folder is to use the built-in StartComponentCleanup task via DISM, which removes older component versions without breaking updates. Do not manually delete files from C:\Windows\WinSxS.
Open Command Prompt as Administrator and run these commands to safely reduce the folder size:
Analyze the folder size:
dism /online /cleanup-image /AnalyzeComponentStoreStart Component Cleanup (Recommended):
dism /online /cleanup-image /StartComponentCleanupReduce size further (removes all old versions, prevents rollback):
dism /online /cleanup-image /StartComponentCleanup /ResetBase
The initial analysis took around an hour to complete, the cleanup took much, much longer...
