How do you repair the component store of Windows Server 2012 Standard?

I tried to do a SFC /scannow on our company's terminal server which is on a virtual machine in Hyper-V.  I got the message back that it found integrity violations, but was unable to fix them.  I ran DISM /Online /Cleanup-Image /RestoreHealth to repair the WinSxS folder, but then got DISM failed.  No operation has been performed.  So I ran Dism /Online /Cleanup-Image /StartComponentCleanup - which I believe tried to compress the folder.  That completed successfully.  Then ran DISM /Online /Cleanup-Image /RestoreHealth -  I got the same message - DISM failed.  No operation has been performed.  I rebooted the server and tried the same thing - same message. It hung at 20% for a while, then at 40%.  I'm I missing a switch with the DISM command to properly fix the WinSxS folder?  My server is online and everyone is out of it, except me.

On our file server, I ran Dism /Online /Cleanup-Image /ScanHealth , just to see if the WinSxS folder is okay, it is. Got the message "No component store corruption detected.  The operation completed successfully."  The terminal server and file server are the same OS - Windows Server 2012 Standard (not R2).  Their Windows Updates history are pretty close (I believe -I'm not sure if that makes a difference)  Can I rename the corrupt WinSxS folder on the terminal server to WinSxS.old, then copy the good WinSxS folder from the file server to WinSxS?  Then would the SFC /Scannow run successfully?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Elango SathyadevSenior Systems EngineerCommented:
Don't Rename the WinSxS folder.

Try by running Dism with Source Windows DVD

Command (Assuming D drive is Cd Drive)

 Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1

Open in new window

If it fails, Try

 Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1  /limitaccess

Open in new window

This will also run by avoiding checking internet for updates and fix corruption without using windows updates.

If this fails can you post logs of the following files


Davester44Author Commented:
It didn't work.  When I ran
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1
it came up with "DISM failed.  No operation was performed"

I then tried
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1  /limitaccess
got "The source files could not be found"

Both scans took about 30 minutes.  I'm using an ISO, I'm not sure if that matters.  It's not the original installation ISO, as the previous IT company that installed the OS is gone.  This server is Windows Server 2012 Standard.  The ISO disk comes up as Windows Server 2012  (no standard).  I'm not sure if that makes a difference.
Davester44Author Commented:
I fixed it. Not with the ISO though.  Our file server had a good component store, as I verified with Dism /online /cleanup-image /CheckHealth on that server.  I mapped the file server's winsxs folder to T: on the terminal server.  Then I ran the command:
Dism /online /cleanup-image /restorehealth /source:T:

After that SFC /scannow completed successfully.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Davester44Author Commented:
My solution resolved the issue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.