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 locally on the server where hyper-v is installed:
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.
thanks a lot, worked like a charm. i appreciate you saving the hair on my head.
The suggested command did not work for me. For those who fall into this category, I resolved by opening Powershell on the host and typing > enable-psremoting -force. This will make the appropriate exceptions in your client firewall.
Great Solution! Many Thanks. I had the issue when the drive hosting my VM’s failed. I replaced the drive, but couldn’t subsequently connect to the Hypervisor.
File ‘C:\Windows\System32\WindowsVirtualization.V2.mof’ not found!
How to Solve the Problem?
also, i found that i had set a static entry in a hosts file but the hv-server was setup on dhcp; so assigning it the correct static ip address worked as I was trying to connect to the wrong system
This fixed my issue too. Thanks!
Worked for me perfectly. God bless save me sleepless nights. Thanks you !
You save my time thank you
OMG, why does Microsoft not do something and write up a knowledge based article that links to this website since so many people, including me, have experienced this ongoing issue. Server is 2019 and the issue is still present 2 years running!
thanks was looking for this for past 8 hours.
Thanks!
Worked perfectly. Good find and thanks for posting it.
Searched for hours for a solution. Your command line did the job in seconds. Thanks a lot.
Thanks, This seemed to happen once I installed the HPE Proliant Support Pack….
Absolute star!
I can confirm this fixed it for me as well. I had the Homepage already installed but seemed to break HV when I installed the WBEM Provider Package – cp037689 on Server 2019
Thank you! worked perfect! Server 2016
I’ve found this solution many times, however non of them state if you run that command on the Server your trying to connect FROM or the server your trying to connect TO.
I have just done it on both, without any luck.
It worked for me perfectly, Thank you
Thanks was driving me crazy this nailed you are a top banana!!!
Thank you, it worked!
Great. It worked. Thanks
This worked for me! Thank you!
wow! this MOF thingy worked perfectly and immediately fixed the issue. Been searching for hours. Thanks a lot
I love you!
1 billion thanks
I love you man saved me!