Quantcast
Viewing all articles
Browse latest Browse all 127

Getting VM information from Hyper-V 2012 via PowerShell

You can get your VMs list, Hyper-V hostname, clustername and csv paths like this: 1 2 3 4 5 6 7 8 9 10 11 $VMs = Get-VM foreach ($VM in $VMs) { $VMName = $VM.Name $VMHostname = $VM.ComputerName $VMHostCluster = (Get-Cluster).Name $VMHardDisk = $VM.ConfigurationLocation $VMHardDiskLocation = $VMHardDisk.Split("\")[2] $Value = $VMName + "," + $VMHostname [...]

Viewing all articles
Browse latest Browse all 127

Trending Articles