Windows Tutorials

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

sfc /scannow

5. Hopefully all has been repaired restart your server, then run some windows updates and you should be good to go. 

I hope this article was helpful, if you have any questions, please feel free to contact me. If you would like to be notified of when I create a new post, you can subscribe to my blog alert.

17 Comments

  1. 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.

  2. 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 ?

  3. Hi Patrick,
    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.

  4. 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
    Version: 10.0.17763.1

    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.
    PS C:\Users\Administrator>

    1. Deployment Image Servicing and Management tool
      Version: 10.0.17763.3406

      Image Version: 10.0.17763.4974
      I am getting this error, if someone has any solution please let me know.
      [===========================95.4%======================= ]
      Error: 0x800f081f

      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. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

      The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log

  5. Hi, Patrick.

    I keep getting this error:

    C:\Windows\system32>dism /online /cleanup-image /restorehealth /source:WIM:d:\sources\install.wim:2 /limitaccess

    Deployment Image Servicing and Management tool
    Version: 10.0.17763.3406

    Image Version: 10.0.17763.4499

    [== 4.5% ]
    Error: 1009

    The configuration registry database is corrupt.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    Not too clear on what to do from here. Thank you.

      1. Hi, Patrick. Can you elaborate? The ISO (this is a virtual machine) is mounted there. That is the correct path. Thanks in advance!

  6. I mounted the image on G: and verified it has the path \sources\install.wim
    both of these commands:
    dism /online /cleanup-image /restorehealth /source:g:\sources\install.wim:2 /limitaccess
    and
    dism /online /cleanup-image /restorehealth /source:WIM:G:\sources\install.wim:2 /limitaccess

    report ‘The source files could not be found.’
    Would it work better if I copied that file to a local HDD?

Leave a Reply to Geoff Whiteley Cancel reply

Stay Informed

Receive instant notifications when new content is released.