- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, we can find the cluster. Try like this
$dcName = "MyDatacenter"
$list = Get-Datacenter -Name $dcName | % {
$datacenter=$_
Get-VMhost -Location $datacenter | Get-VMHostHBA -Type FibreChannel | where {$_.Status -eq "online"} |
Select @{N="Datacenter";E={$datacenter}},
@{N="Cluster";E={
if($_.VMHost.ExtensionData.Parent.Type -ne "ClusterComputeResource"){"Stand alone host"}
else{
Get-view -Id $_.VMHost.ExtensionData.Parent | Select -ExpandProperty Name
}
}},
@{N="VMHost";E={$_.VMHost.Name}},
Device,Status,
@{N="WWN";E={((("{0:X}"-f $_.PortWorldWideName).ToLower()) -replace "(\w{2})",'$1:').TrimEnd(':')}}
}
#Output CSV to current directory.
$list | export-csv -NoTypeInformation C:\output.csv
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference