How to repair Windows Server 2019 installation with DISM
In this tutorial you will learn how to repair Windows Server 2019 installation with DISM. If you’re experiencing problems with your Windows Server 2019 installation, using the DISM /restorehealth can help repair it. DISM is a command-line tool that can scan and fix issues with Windows images, including those used by the Server operating system. This process can be done by following a few simple steps such as opening an elevated command prompt, running the DISM tool, waiting for the process to complete, and restarting your system.
Remember to always have a backup. Or if it’s a virtual machine at least a snapshot.
1.Lets get started by Opening up CMD as administrator and running the following:
dism /online /cleanup-image /scanhealth
2. Once /scanhealth is complete, run the following.
dism /online /cleanup-image /checkhealth
3. Now lets mount your Windows Server 2019 ISO as a drive. Take note of your mounted drive letter because you may need to change it to reflect it within this next command. Start elevated command prompt.
dism /online /cleanup-image /restorehealth /source:WIM:d:\sources\install.wim:2 /limitaccess
4. Now run the following to find and repair additional corruption
5. Hopefully all has been repaired restart your server, then run some windows updates and you should be good to go.
I keep getting “The source files could not be found” at the end of: dism /online /cleanup-image /restorehealth /source:d:\sources\install.wim:2 /limitaccess (I also tried to leave off the /limitaccess – same result).
I’m using an external USB DVD drive (D:) with the Windows Server 2019 distro. It does fire up at the beginning of the process but goes quiet for the remainder – could that be the file not found problem?
I explored: For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077 but that doesn’t have clear instructions – typical of Microsoft, the instructions assume a higher level than amateur and are indecipherable to the lay person.
In any case, the 2 previous (scanhealth & checkhealth) seemed to work, so now I’l try the sfc /scannow step and see what happens.
Thanks for your very clear instructions and I hope you might be able to shed some light on crossing this hurdle.
I left off the WIM:d: part in the above script, which I did include in the dism command
Figured it out, downloaded the ISO file, mounted it and it worked. Thanks
Thank you for the visit. I apologize for my delayed response. I am glad you were able to get through it.
Keep ketting: The source files could not be found.
Use the “Source” option to specify the location of the files that are required to restore the feature
Mounted the image on E: and use the command: dism /online /cleanup-image /restorehealth /source:e:\sources\install.wim:2 /limitaccess or
dism /online /cleanup-image /restorehealth /source:WIM:E:\sources\install.wim:2 /limitaccess
what am i doing wrong ?
Does the ISO you are using contain that path E:\sources\install.wim ? I suggest downloading a new IS if it does not.
Thx for you comment, send you a e-mail with printscreens the ISO has a install.wim but still getting “The source files could not be found”
please check my e-mail to you with all the information.
Hi, consider these results.
PS C:\Users\Administrator> dism /online /cleanup-image /restorehealth /source:WIM:d:\sources\install.wim:2 /limitaccess
Deployment Image Servicing and Management tool
Image Version: 10.0.17763.107
[==========================100.0%==========================] The restore operation completed successfully.
The operation completed successfully.
PS C:\Users\Administrator> sfc /scannow
Beginning system scan. This process will take some time.
Beginning verification phase of system scan.
Verification 100% complete.
Windows Resource Protection found corrupt files and successfully repaired them.
For online repairs, details are included in the CBS log file located at
windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. For offline
repairs, details are included in the log file provided by the /OFFLOGFILE flag.