How to Fix DISM Error 87 in Windows Server 2016 and Windows 10

Photo of author

By Victor Ashiedu

Published

Introduction

DISM Error 87 in Windows Server 2016 can be cause by any of the following:

  1. Running DISM command with a space between DISM and one of the switches or space in any of the switches.
  2. Using /Online parameter with just /Cleanup-Image without /RestoreHealth
  3. Running DISM /Image:c:\ from within Windows

How to Fix DISM Error 87 in Windows Server 2016

Now that you know what could cause DISM error 87, here are the steps to fix it.

Remove Any Space from the Command and Include Forward Slash (“/”) before a Switch

The first thing to check is that there are no spaces with your command. Also ensure that you use “/” before any DISM switch. Finally, do not leave a space between “/” and a DISM switch.

To run any of the command discussed in this guide, open command prompt as administrator.

Search command prompt, right-click it then select Run as administrator.

Lets see how each of the situations described throws DISM error 87 in Windows Server 2016.

Type the command below in command prompt then press enter.

DISM /Online/Cleanup-Image /RestoreHealth

Here is the result. Error: 87 “The online/cleanup-image option is unknown.”

dism error 87 server 2016

Now, I will run the command with a space.

DISM /Online /Cleanup-Image /RestoreHealth

Command is running successfully!

Another command mistake that causes error 87 is to exclude the “/” before a DISM switch.

To see how this could cause the error message, type this command and press enter:

DISM /Online Cleanup-Image /RestoreHealth

Here is DISM error 87 in Windows Server 2016 again!

Solution? Add a “/” before Cleanup-Image. Here is the amended command:

DISM /Online /Cleanup-Image /RestoreHealth

When you Use /Online, Include /Cleanup-Image and /RestoreHealth

dism error 87 server 2016

Another command mistake that leads to DISM error 87 is to run the command shown below:

DISM /Online /Cleanup-Image

Here is the DISM error message:

Error 87: “An error occurred while processing the command. Ensure that the command-line arguments are valid”

dism error 87 server 2016

The fix? Use the complete command parameters as show below:

DISM /Online /Cleanup-Image /RestoreHealth

To Run DISM Within Windows Use /Online Instead of /Image Switch

To Run DISM Within Windows Use /Online Instead of /Image Switch

Another cause of DISM error 87 is to use /Image switch from within Windows.

Here is a sample command:

 DISM /Image:c:\ /Cleanup-Image /RestoreHealth

The command returned error: 87:

“The /Image option that is specified points to a running Windows installation. To service the running operating system, use the /Online option.”

The fix? Modify the command as shown below:

 DISM /Online /Cleanup-Image /RestoreHealth
To see how you can run DISM /Image:c:\ /Cleanup-Image /RestoreHealth command read How to Fix DISM Error 50 in Windows 10 and Windows Server 2016.

If None of the Above Worked, Run SFC /Scannow Before DISM

If none of the above is the reason for DISM error 87 in Windows Server 2016, try the following:

  • Type this command and press enter
SFC /Scannow

Wait for the command to complete. If it returns errors, restart your server then run your DISM command.

Conclusion

One of the fixes discussed in this guide should resolve DISM error 87.

I hope you found this Itechguide helpful. If it was helpful please spare a few minutes to share your thoughts with [discourse_topic_url]. Similarly, if the article did not fix the problem or you still have some questions, please reply to this article’s topic at [discourse_topic_url].

Our Content Engagement team and other community members will come back to you with a fix as soon as possible.

Want more Widows Server fixes? Visit our Windows Server Fix page.

We go the extra mile to deliver the highest quality content for our readers. Read our Content Writing, Content Review, and Anti-Plagiarism policies to learn more.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

If this article does not meet your expectations, kindly let us know. We have various ways you can get in touch with us:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

2 thoughts on “How to Fix DISM Error 87 in Windows Server 2016 and Windows 10”

  1. Victor Ashiedu,
    You, sir, are a genius.
    Thank You So Much!
     
    It was something as simple as putting a space before the forward slash that had me almost completely bald before I found you.
    Thanks Again
     

    Reply

Leave a comment