While setting up a new Hyper-V failover cluster I got an error when trying to connect using the Hyper-V manager console:
An error occurred while attempting to connect to server “[computername]”. Check that the Virtual Machine Management service is running and that you are authorized to connect to the server.
Hyper-V encountered an error trying to access an object on Computer ‘[computername]’ because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.
There is nothing in the logs and everything I tried didn’t work. In the end uninstalling the Hyper-V role and reinstalling it did fix the issue. However, sometimes simply reinstalling roles is not possible. When I experienced the same error again on another machine I investigated a bit more and finally ended up in restoring the Hyper-V WMI registration which fixed the issue without reinstalling the role.
You can do so by running the following command in an elevated command prompt:
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

Thanks, it worked perfectly! Thumbs up. :-)
Thank you, that saved me a lot of time. I was about to re-install the whole machine to be sure that everything works fine. I assume that the error occured because I installed HPE Management Software which depends on WMI right after I installed the Hyper-V role. I wasn’t aware that this destroys the whole system ;o)
Best regards
Dave :o)
Thankyou, you saved me a world of pain !
Thanks that worked perfectly.
Thanks a lot. It worked for me too.
Thanks!!
Thanks a lot.
Worked like a charm.
Thanks a lot.
Just had the issue today. Did a google search and your article came up on top. Lucky me. This fixed it. Thank you.
Thank you!
As somebody mentioned here also, it has something to do with installing HPE System Management Homepage after installing Hyper-V.
Nice find, thumbs up.
I can confirm this fixed it for me as well. I had the Homepage already installed but only when I installed the WBEM Provider Packager – cp031735 the error occured (for me at least)
Cheers
before doing this, use your domain administrator credentials if you have one if not use this command.
I got messege: file not found.
File ‘C:\WINDOWS\System32\WindowsVirtualization.V2.mof’ not found!
UAU!! Thanks!!
Got this as a reply: Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\WINDOWS\system32> MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
Microsoft (R) MOF Compiler Version 10.0.17134.1
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: C:\WINDOWS\System32\WindowsVirtualization.V2.mof
MOF file has been successfully parsed
Storing data in the repository…
An error occurred while opening the namespace for object 1:
0X80041002 Class, instance, or property ” was not found.
Compiler returned error 0x80041002
PS C:\WINDOWS\system32>
Thanks for this article, it fixed the issues I was having with HyperV manager and HyperV 2016 core server.
Worked perfectly! Thanks for posting!
Wow. Thank you for this simple and effective article. Also happened after HPE software install.
This fixed it! Thanks! Issue occurred on 11/13/2018 spontaneously on a computer I use Hyper-V on extensively. I literally had several VMs already open, left for a meeting, and came back to this error. Rebooting did not solve it. This did.