[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

Davoud Teimouri

Professional blogger, vExpert 2015/2016/2017/2018/2019/2020/2021/2022/2023, vExpert NSX, vExpert PRO, vExpert Security, vExpert EUC, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

2 Responses

  1. 25/01/2024

    […] [Script]: Find ESXi HBA WWN via PowerCLI […]

  2. 26/01/2024

    […] [Script]: Find ESXi HBA WWN via PowerCLI […]

Leave a Reply

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