Helena Raia
Helena Raia

Reputation: 35

Remotely connecting to Hyper-V machine from VM

I'm new to the concept of Hyper-V and how it works, so I'm not sure if this is a good question.

I have a server that contains the Hyper-V, and from the Hyper-V I connect to a VM (VM1). The VM1 contains Orchestrator that will be used to automate some jobs related to the machines in the Hyper-V sever. So I need to run some PowerShell commands, in VM1, to check the Snapshots of all the machines in the Hyper-V server. I already installed the Hyper-V PowerShell module in VM1. My question is, in order to get information about the machines in Hyper-V through VM1:

It's a bit difficult to explain, like I said I'm new to this topic. But I'm available to answer any question if my explanation was a bit confusing.

Upvotes: 0

Views: 380

Answers (1)

Judd Davey
Judd Davey

Reputation: 349

From VM1, you should be able to connect to the Hyper-V host using -computername and -name to reference the name of the VM:

$Host = "HypervHostServer"
$VM = "virtualmachine1"
Get-VM -ComputerName $Host -Name $VM

To see all virtual machines:

$Host = "HypervHostServer"
Get-VM -ComputerName $Host

Upvotes: 0

Related Questions