Windows Tutorials

How to repair Windows Server 2022 installation with DISM

In this tutorial, you will learn how to repair a Windows Server 2022 installation using DISM (Deployment Image Servicing and Management). DISM is a powerful command-line tool for scanning and fixing issues in Windows images, including server operating systems. If your Windows Server 2022 is experiencing problems, the DISM /restorehealth command can be an effective solution. Here’s a step-by-step guide:

Microsoft Windows Server 2022

Preparation:

  • Ensure you have a backup of your data. For virtual machines, consider creating a snapshot.
  • Mount your Windows Server 2022 ISO as a drive and note the drive letter.

Steps:

  1. Open Command Prompt as Administrator: Start by launching Command Prompt with administrator privileges.
  2. Scan for Health Issues: Enter the command:
dism /online /cleanup-image /scanhealth

This will scan your system for any issues.

3.Check the Health Status: After the scan completes, run:

dism /online /cleanup-image /checkhealth

This checks the health of your Windows image.

4. Restore System Health: With your ISO mounted, use the following command (replace d: with your ISO drive letter if different):

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

This restores the system health using the Windows Server 2022 image.

5. Repair Additional Corruption: Next, run:

sfc /scannow

This scans for and repairs any additional file corruption.

6. Restart and Update: After completing these steps, restart your server. It’s advisable to run Windows Update post-restart to ensure all components are up to date.

Conclusion:

This tutorial should help you repair your Windows Server 2022 installation. If you encounter any issues or have questions, feel free to reach out. Don’t forget to subscribe to my blog for more useful posts like this.

I hope this article was helpful! You can find more here: Windows Articles


Discover more from Patrick Domingues

Subscribe to get the latest posts sent to your email.

author avatar
Patrick Domingues

5 Comments

  1. Hi Patrick, my VM is not allowing me to get to the Command Prompt at all. As soon as I ‘start’ it on Hyper-V and ‘connect’ to it, the very initial screen says “Boot failure. Reboot and select proper Boot device or Insert Boot Media in selected Boot Device”.

  2. If your using Datacenter Edition or Core Installation you have use another Image Index (i.E. 4 for Datacenter). Otherwise you will get error 0x800f081f (source not found).

  3. Patrick,

    I have a Windows Server 2022 that is stuck in the SFC “needing a system repair, please reboot server” mode. When I run sfc /scannow the error says a system repair is in progress, please restart server. The problem is that the component store was corrupted and the sfc /scannow was run before dism was used to repair the image. The image is now repaired and all dism commands provide good results, but sfc is still stuck. I have found that no windows updates will complete, the server roles and features are not displayed, and msconfig always reverts to selective startup.

    I have a good image of the system state, but server restore requires that I restart the server in DSRM mode (active directory on the volume) but I am remote to the server (about 350 miles).

    i was wondering if you had any ideas to clear the sfc so that I could run it again with the repaired image store.

  4. Patrick, I have a Windows Server 2022 that is stuck in the SFC “needing a system repair, please reboot server” mode. When I run sfc /scannow the error says a system repair is in progress, please restart server. The problem is that the component store was corrupted and the sfc /scannow was run before dism was used to repair the image. The image is now repaired and all dism commands provide good results, but sfc is still stuck. I have found that no windows updates will complete, the server roles and features are not displayed, and msconfig always reverts to selective startup. I have a good image of the system state, but server restore requires that I restart the server in DSRM mode (active directory on the volume) but I am remote to the server (about 350 miles). i was wondering if you had any ideas to clear the sfc so that I could run it again with the repaired image store.

Leave a Comment

Stay Informed

Receive instant notifications when new content is released.