I seem to always have to go hunting for the syntax to run DISM /restorehealth, so here are a few quick examples.
The basic command for online cleanup:
dism /Online /Cleanup-Image /RestoreHealth
If it complains about not finding sources, you can mount the installation ISO (right click, Mount), then use it as a drive. Let’s assume it’s a .wim file on drive F.
First we need to determine which index of the WIM file contains the OS you are repairing:
dism /Get-WimInfo /WimFile:F:\sources\install.wim
In this case, we want index 2, Server 2016 with a GUI (“Desktop Experience”). Specify that index after the last colon in the /Source parameter:
dism /Online /Cleanup-Image /RestoreHealth /Source:wim:F:\sources\install.wim:2