Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 210400

Re: Script to output WWN Datacenter Cluster Host

$
0
0

Rob,

 

You can try the following code. It should be a pretty good starter point at the very least. I don't have a FC HBA in my home lab to work out any kinks with the WWN info so that'll have to wait until tomorrow.

 

$vmhosts = Get-VMHost

$HBAInfo = @()

Foreach ($vmhost in $vmhosts) {

    $HBAs = $vmhost | Get-VMHostHba -Type FibreChannel

    $DC = (Get-Datacenter -VMHost $vmhost).Name

    $Cluster = (Get-Cluster -VMHost $vmhost).Name

    Foreach ($HBA in $HBAs) {

        $Details = "" | Select WWN, Datacenter,Cluster,Host

        $Details.WWN = $HBA.PortWorldWideName

        $Details.Datacenter = $DC

        $Details.Cluster = $Cluster

        $Details.Host = $vmhost.Name

        $HBAInfo += $Details

    }

}

$HBAInfo


Viewing all articles
Browse latest Browse all 210400

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>