Show WWN of FC devices

First you need to connect to a vCenter:

Connect-VIServer -Server VCENTERIP -User USERNAME -Password PASSWORD

Get-VMHost | Sort | Select Name,
     @{N="FC Device";E={[string]::Join(",",(($_ | Get-View).Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq "HostFibreChannelHba"} | %{$_.Device}))}},
     @{N="FC WWN";E={[string]::Join(",",(($_ | Get-View).Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq "HostFibreChannelHba"} | %{"{0:x}" -f $_.NodeWorldWideName}))}}

Disconnect-VIServer -Server VCENTERIP -Force -Confirm:$false

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.