Just repeating in one spot the two solutions for this problem, since I spent a bit of time being stymied by this on two separate occasions now. The first thing to try from the command line is:
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
If that doesn’t work, are any of your VM’s non-startable? For example do you have an old VM you didn’t plan to use anymore so you stopped it and deleted the VHD but left the entry? If so you may encounter the error in the title when trying to add a new VM or similar. If so delete the entry that is no longer needed.
If that doesn’t work, drop down to powershell and run
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
This will disable/remove the Hyper V feature. Reboot and the re-install with
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
The last solution was required when I switched to a new router on my network, afterward Hyper-V core showed only one NIC (there are two physical on the machine) but everything else ran fine. Until I tried to add a new VM a few weeks later, then I got the message at the top. You will have to setup new virtual switches and reconfigure your VM’s to use them in this case.
Reference : https://serverfault.com/questions/859019/hyper-v-encountered-an-error-trying-to-access-object-on-computer
“MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof”
helped, thanks a bunch
Ok, I just ran into the Hyper-V has encountered an error trying to access an object and I could not do anything with it…
I executed the MOFCOMP command and voila! Everything came back.
What does this thing do and better yet, why did I have to do this?
I’ve tried all the suggestions HYper V just will not work always getting “Hyper V Encountered AN error.∞
After trying about 4 suggested fixes, I managed to get Hyper-V to work again by following the sceond solution in this post. Thanks a lot!!