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