When setting up connectivity between SANs and hosts knowing the HBA information is important. With Pure Storage the WWNs are automatically discovered if zoned properly to the fabric. So from the GUI you will see the WWNs. But who do those WWNs belong to? Knowing the associated ports to host is important for setting up all the individual hosts with proper pathing.

But first a question, “why use Get-WmiObject when there is the easy way using Get-InitiatorPort?” Well duh, because WMI is cooler. With the built in cmdlet, Get-InitiatorPort, you can retrieve the below which provides all the details needed.

Using Windows Management Instrumentation (WMI) there are a lot of other properties that can be queried. Below is an example of when I setup the initial lab environment at Pure Storage for working on Microsoft solutions.

From November 27.2013 —–

I was setting up a new Pure Storage FA-420 array this past week and needed the Host Bus Adapter (HBA) information, specifically the WWNodeName and WWPortName for the QLogic 2562, so I put together this PowerShell that provides all the details. Currently the script takes a single server name and should be run on the server that has the HBA installed. This was a quick solution and I wanted to get this posted but I’ll be tweaking the script to handle multiple servers and different output options.

For formatting using the OutGridView, Format-Table or output to a file using Out-File.