[Script]: Find ESXi HBA WWN via PowerCLI
You know, PowerCLI is one of vSphere scripting and automation tools and most of administrators using it for automation and doing their job faster than working with GUI.
Finding ESXi host information and exporting those information is very simple and fast via PowerCLI. I want to show you, finding ESXi HBA WWN by PowerCLI in this post.
The script is so simple, if you want to find HBA information about specific ESXi host, you can customize that.
The below script can help you to find WWN addresses for all your ESXi hosts in a cluster:
Get-Cluster | Get-VMhost | Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | Sort VMhost,Device
To find WWN addresses of a specific host, change the script same as the below:
Get-VMhost -Name {ESXi Host Name}| Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | Sort VMhost,Device