question

Jim-2982 avatar image
0 Votes"
Jim-2982 asked YuhanDeng-MSFT commented

Can not get Hyper-V VM info on remote host

I'm trying to set up remote Hyper-V management following the guide here[1] but failed. When I try to connect to the remote server, it says "An error occurred while attempting to connect to server "XXX". Check that the Virtual Machine Management service is running and that you are authorized to connect to the server."

To figure out the reason, I have tried

  1. Perform Get-VM -ComputerName XXX -Credential XXX\YYY, it says "Get-VM : Hyper-V encountered an error trying to access an object on computer 'XXX' because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running."

  2. Perform Invoke-Command -ComputerName XXX -Credential XXX\YYY -ScriptBlock { Get-VM }, it returns the expected results.

It seems weird that Get-VM can run with Invoke-Command but fails on its own. Any guidance would be appreciated.

The Hyper-V host and client are both running Windows 10 Pro of build 19043.1055.

[1]: https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/remotely-manage-hyper-v-hosts





windows-server-powershellwindows-10-hyperv
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

I would like to check if the issue has been fixed? If yes, please help accept answer, so that others meet a similar issue can find useful information quickly. If you have any other concerns or questions, please feel free to feedback.

Best Regards,
Danny

0 Votes 0 ·

Hi,

I would like to check if the issue has been fixed? If yes, please help accept answer, so that others meet a similar issue can find useful information quickly. If you have any other concerns or questions, please feel free to feedback.

Best Regards,
Danny

0 Votes 0 ·
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Jim-2982 commented

Hi,
The invoke-command returns everything it gets, including the errors.
Also have you tried restarting VMMS service on your VMs? It seems that the VMMS service is somehow related to it according to the second paragraph.

Thanks for your time.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Danny,

I tried to restart the vmms service on the remote side and perform the same commands but the problem resists. Here's a screenshot:

105409-1.png

I performed Invoke-Command twice to ensure vmms on the remote side is running normally.

Besides, I can always run Get-VM on the remote side with no error.

Any suggestions would be helpful!



0 Votes 0 ·
1.png (70.6 KiB)
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Jim-2982 commented

Hi,
I did some research, and I found this, you might want to take a look:
https://hungdoan.com/2019/12/25/hyper-v-encountered-an-error-trying-to-access-an-object-on-computer/
Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Also there's this article that provided several solutions that you might want to try:
https://social.technet.microsoft.com/Forums/en-US/0a29c671-b640-4c2d-954f-622b25f65ad9/hyperv-encountered-an-error-trying-to-access-an-object-on-computer-object-was-not-found?forum=win10itprovirt

Hope this will help.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Danny,

I have tried them all but the problem resists. Also, I want to share an interesting fact. As shown in the following figures, I performed the same commands twice, but they return different results:

106316-1.png
106333-2.png

Actually, these two kinds of returns show in an arbitrary way. I have no idea why the same inputs would have different results.




Best,
Jim

0 Votes 0 ·
1.png (52.4 KiB)
2.png (18.0 KiB)
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Jim-2982 commented

Hi Jim,
Based on my understanding, your main concern is to connect to another host using hyper-v manager, is that correct?
If it’s correct, may I ask if the two hosts are in the same domain/workgroup? Also I want to know the OS system of the hosts.

Thanks for your time.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Danny,

Currently, they are under the same LAN but not same domain. I expect they are under the same workgroup. Besides, both systems are Windows 10 Pro, build 19043.1055.

Thanks!

0 Votes 0 ·
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered

Hi Jim,
To add or remove computers from a domain/workgroup using powershell, you can refer to this article:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-computer?view=powershell-5.1

Thanks for your time.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.