Get vm host and cluster Powercli

$Clusters = get-cluster
$Result =@(

Foreach ($Cluster in $Clusters)
{
$VMhosts = Get-VMHost -Location $Cluster
foreach($VMhost in $VMhosts)
{
[pscustomobject]@{

“Host” = $VMhost.Name
“Cluster Name” = $Cluster

}
}
}

)
$Result

Leave a Comment

Your email address will not be published.

Comment moderation is enabled. Your comment may take some time to appear.

In the news
Load More