I'd like to be connected to multiple VIservers and list all the VMs + their respective clusters. Is this possible?
I've gotten as far as Get-VM | Select Name,VMHost
. What property in place of VMHost would list the cluster?
A cluster of virtual machines across physical hosts (also known as a cluster across boxes) protects against software failures and hardware failures on the physical machine by placing the cluster nodes on separate ESXi hosts.
To see all VMs on the local Hyper-V host, you should run the Get-VM cmdlet. On the PowerShell screen, you can see the list of available VMs, including their name, state, CPU usage, memory assigned, uptime, status, and version.
Type msinfo32 and press Enter. In the right pane, look for System Manufacturer for 'VMware, Inc. ' If this is present, you are running within a virtualized platform, and cannot install another virtualization product on top of it.
$Data = @(); $VMs = Get-VM $VMName; foreach($VM in $VMs){ $VMCustom = New-Object System. Object; $VMCustom | Add-Member -Type NoteProperty -Name VMName -Value $VM. VMName; # Get-VMNetworkAdapter -VMName $VMName | Select -expand IPAddresses $VMCustom | Add-Member -Type NoteProperty -Name IPAddress -Value $VM. guest.
Try that
Get-VM | Select-Object -Property Name,@{Name=’Cluster’;Expression={$_.VMHost.Parent}}
which I found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With