Fixing component store corruption

by joscon [Microsoft]

One of the most used tools when fixing corruption for Windows Vista, 7, 2008 and 2008 R2 was the System Update and Readiness Tool (KB947821), commonly called CheckSUR. The CheckSUR tool was an excellent way for most people to see what corruption had happened on their store, and potentially fix that corruption if the tool contained the payload to do so. I’ve written in the past how to use this mechanism to also fix corruption when the CheckSUR utility doesn’t include the payload for your files to “fool” CheckSUR into resolving the problem without needing to do all sorts of whacky permission changes (Using CheckSUR and update packages to fix corruption - The Windows Servicing Guy - Site Home - TechNet Blogs).

The way this works in Windows 8 and Windows Server 2012 is different, in a fantastic way. It’s called Inbox Corruption Repair and it brings the functionality of CheckSUR into Windows rather than requiring a separate download to get the utility like you do now. This is exposed in two ways, the first is really unseen by the end user and happens when we detect a corrupted state when attempting to install fixes via Windows Update. When this happens, we'll fix the corruption silently and then re-install the prior packages. The manual way to use this tool is via DISM. The way this is exposed is via the DISM /Cleanup-Image functionality. Here’s what the available switches do:

/CheckHealth: This checks to see if a component corruption marker is already present in the registry. We’ll inform the user if there is corruption but nothing is fixed or logged anywhere. This is merely a quick way to see if corruption currently exists. Think of it as a read-only CHKDSK. This operation should be almost instantaneous.
/ScanHealth: This checks for component store corruption and records that corruption to the C:\Windows\Logs\CBS\CBS.log but no corruption is fixed using this switch. This is useful for logging what, if any, corruption exists. This operation takes ~5-10mins.

/RestoreHealth: This checks for component store corruption, records the corruption to C:\Windows\Logs\CBS\CBS.log and FIXES the corruption using Windows Update. This operation takes ~10-15mins or more depending on the level of corruption.

© 2014 Microsoft
Full article from Microsoft Corporation - Fixing component store corruption in Windows 8 and Windows Server 2012 - The Windows Servicing Guy - Site Home - TechNet Blogs