Extracting information about Hyper-V hosts and the associated virtual machines
Microsoft offers the ability to extract information related to the Hyper-V infrastructure using PowerShell. It is now possible to perform virtual machine management from the command line using the Hyper-V PowerShell module.
Let's start exploring the ways in which you can extract information related to a Hyper-V host.
For Hyper-V deployments that are not clustered, host-level information can be extracted by the Get-VMHost
cmdlet:
Get-VMHost | fl *
Open up a PowerShell prompt in your Windows Server 2012 R2 Hyper-V server in the Run as Administrator mode and type the following cmdlets:
Get-ClusterNode
: This cmdlet shows details of the nodes in the clusterGet-ClusterNode | select @{l='ComputerName';e={$_.name}}
: This cmdlet shows the names of the Hyper-V hosts in the clusterGet-VMHost –computername <HVHostName>
: This cmdlet shows details of the Hyper-V hosts
Now, by combining all the preceding...