I originally had a post on how to clean up WinSXS from 2014. However, I have come across a program that I have tested, and works very well.
The program is Patch Cleaner. This program scans your Installer folder to check if there are orphan files relating to programs or patches you may have removed from your computer. Any orphan files Patch Cleaner locates can be removed.
I have tested Patch Cleaner on Server 2012 and 2012 R2, including production terminal servers with 100 users. I have no had any issues thus far.
With Server 2012, running Patch Cleaner was removing on average 20GB+ on each server.
I would recommend checking this out if you are still stuck for space.
WinSX has been the bane of many system engineers, including me. There have been many hacks and workarounds to try and shrink the size of the WinSX folder. None of them really worked, and at worst, caused significant problems with the Windows operating system.
We now have hope. There is finally a way to cleanup the WinSXS folder on Windows8 and Server 2012. I must stress, this is most beneficial for Server 2012 operating systems.
With current versions of Windows, all roles and files are available on the system. This means when you go to add a new role or feature, you’re not prompted to supply media to copy system files. This was very common with Windows 2000 and 2003, and a real pain.
The downside to this approach is when Windows checks for updates, updates are downloaded for all roles and features currently available on the system, regardless of whether you are using them or not. What this leads to is a huge WinSXS folder.
To clean up a Windows 2012 server, find out what roles are currently available:
Open an administrative PowerShell command prompt
Type Get-WindowsFeature to get a list of Windows Roles
To uninstall a role, use the following command Uninstall-WindowsFeature –name <name of role/feature> -remove