PoshCode Archive  Artifact [73202b7d0f]

Artifact 73202b7d0f5081a2d20b43240374e4c78b8faa2546ce8e77954b798447b92e9b:

  • File FC-WWN-per-vendor.ps1 — part of check-in [3a49199eba] at 2018-06-10 13:47:34 on branch trunk — Get’s FC adapter WWN’s listed per vendor of ESXi hosts per Cluster (user: Leon Scheltema size: 1047)

# encoding: ascii
# api: powershell
# title: FC WWN per vendor
# description: Get’s FC adapter WWN’s listed per vendor of ESXi hosts per Cluster
# version: 0.1
# type: script
# author: Leon Scheltema
# license: CC0
# x-poshcode-id: 4893
# x-archived: 2015-05-22T02:52:57
# x-published: 2015-02-12T10:36:00
#
#
# Script to fetch all FC adapter WWN's per Cluster
# By Leon Scheltema AVANCE ICT Groep Nederland

# Begin variables
$VC1 = ""
$cluster = ""
# End variables

# Connect to vCenter server
Connect-VIServer "$VC1"

$scope = Get-VMHost     # All hosts connected in vCenter
$scope = Get-Cluster -Name $cluster | Get-VMHost # All hosts in a specific cluster
foreach ($esx in $scope){
Write-Host "Host:", $esx
$hbas = Get-VMHostHba -VMHost $esx -Type FibreChannel
foreach ($hba in $hbas){
$wwpn = "{0:x}" -f $hba.PortWorldWideName
Write-Host `t $hba.Device, "|", $hba.model, "|", "World Wide Port Name:" $wwpn
}}

# Disconnect from vCenter server
Disconnect-VIServer -server "$VC1" -Force -Confirm:$false