MD4SV
Contributor
Contributor

I believe this will help you with your request though I cannot take credit for the script.

http://communities.vmware.com/thread/389982

One way that you should be able to get HostSystems' HBA WWN info is like:

## get all HostSystems' .NET View object
Get-View -ViewType HostSystem -Property name, Config.StorageDevice.HostBusAdapter | %{
   
$viewHost = $_
   
## for each HBA that is a HostFibreChannelHba, get some info
    $viewHost.Config.StorageDevice.HostBusAdapter | ?{$_ -is [VMware.Vim.HostFibreChannelHba]} | %{
       
New-Object -TypeName PSObject -Property @{
            VMHostName
= $viewHost.Name
           
## the HBA Port WWN in hexadecimal, with each octet split by ":"
            HBAPortWWN = (("{0:x}" -f $_.PortWorldWideName) -split "(\w{2})" | ?{$_ -ne ""}) -join ":"
           
## the HBA Node WWN in hexadecimal, with each octet split by ":"
            HBANodeWWN = (("{0:x}" -f $_.NodeWorldWideName) -split "(\w{2})" | ?{$_ -ne ""}) -join ":"
           
## the HBA status ("online", for example)
            HBAStatus = $_.Status
        }
## end new-object
    } ## end foreach-object
} | Select VMHostName, HBAPortWWN, HBANodeWWN, HBAStatus | Sort VMHostName

This gets each host, and for each fiber channel HBA in the host, lists the Node- and Port- WWN in hex.  The output would be something like:

VMHostName             HBAPortWWN                  HBANodeWWN                  HBAStatus
----------             ----------                  ----------                  ---------
myhost0.domain.com     10:00:00:00:00:00:00:e0     20:00:00:00:00:00:00:e0     online
myhost0.domain.com     10:00:00:00:00:00:00:5b     20:00:00:00:00:00:00:5b     online
myhost1.domain.com     10:00:00:00:00:00:00:77     20:00:00:00:00:00:00:77     online
myhost1.domain.com     10:00:00:00:00:00:00:58     20:00:00:00:00:00:00:58     online
...