When the storage team asks for your server's WWNs to set up SAN zoning or LUN masking, you don't need the HBA vendor's tools. Windows shows them through PowerShell. The quickest way is Get-InitiatorPort, which works on Windows Server 2012 and later.

Applies to: Windows Server 2012, 2012 R2, 2016, 2019, 2022, 2025 (and Windows 10 / 11) with Fibre Channel or iSCSI initiators.

Quick answer: Get-InitiatorPort

Get-InitiatorPort | Select-Object InstanceName, NodeAddress, PortAddress, ConnectionType

Get-InitiatorPort

  • PortAddress is the WWPN, the value the storage team needs for zoning.
  • NodeAddress is the WWNN, which identifies the HBA itself.
  • ConnectionType is Fibre Channel, iSCSI, SAS and so on.

To show only Fibre Channel ports, with colons the way most SAN tools display WWNs:

Get-InitiatorPort -ConnectionType FibreChannel | ForEach-Object {
    [pscustomobject]@{
        Adapter = $_.InstanceName
        WWNN    = ($_.NodeAddress -replace '(..)(?!$)', '$1:')
        WWPN    = ($_.PortAddress -replace '(..)(?!$)', '$1:')
    }
}

Example output: WWPN : 10:00:00:90:fa:12:34:56.

Method 2: WMI / CIM (any Windows version)

If Get-InitiatorPort isn't available, or you want the raw adapter data, query the Fibre Channel WMI classes. The port WWN (WWPN) comes from MSFC_FibrePortHBAAttributes:

Get-CimInstance -Namespace root\WMI -ClassName MSFC_FibrePortHBAAttributes | ForEach-Object {
    ($_.Attributes.PortWWN | ForEach-Object { '{0:x2}' -f $_ }) -join ':'
}

The node WWN (WWNN) comes from MSFC_FCAdapterHBAAttributes:

Get-CimInstance -Namespace root\WMI -ClassName MSFC_FCAdapterHBAAttributes | ForEach-Object {
    ($_.NodeWWN | ForEach-Object { '{0:x2}' -f $_ }) -join ':'
}

WWN on Windows 2012 R2

Use {0:x2}, not {0:x}. With {0:x}, a byte like 0x05 prints as 5 instead of 05, so the WWN comes out short and won't match what the switch shows. An earlier version of this post had that mistake.

Collect WWNs from several servers at once

Handy when you're zoning a whole Hyper-V or SQL cluster:

$servers = 'HV01','HV02','HV03'
Invoke-Command -ComputerName $servers -ScriptBlock {
    Get-InitiatorPort -ConnectionType FibreChannel |
      Select-Object @{n='Server';e={$env:COMPUTERNAME}}, InstanceName, PortAddress
} | Select-Object Server, InstanceName, PortAddress | Export-Csv C:\Temp\wwpn.csv -NoTypeInformation

Get-InitiatorPort returns nothing?

  • No Fibre Channel HBA, or its driver isn't installed. Check Device Manager → Storage controllers. If the HBA appears as an unknown device, install the vendor driver. WWNs only show up once Windows has a proper driver for the card.
  • Only iSCSI is in use. iSCSI has no WWN. Its identifier is the IQN, shown in NodeAddress for the iSCSI initiator port, or with (Get-InitiatorPort -ConnectionType iSCSI).NodeAddress.
  • Inside a Hyper-V VM using virtual Fibre Channel: the WWNs are set on the host. Run Get-VMFibreChannelHba -VMName <vm> on the Hyper-V host. Each virtual adapter has two address sets (A and B), and both need zoning for live migration to work.

WWNN vs WWPN

WWNN (Node) WWPN (Port)
Identifies The HBA card Each individual port on the card
Per dual-port HBA Usually 1 2
Used for zoning? Rarely Yes

When the storage admin asks for "the WWN", they almost always mean the WWPN of each port.

FAQ

Can I find the WWN without PowerShell?

Yes. In Device Manager, the HBA's properties sometimes show it on a vendor tab, and the HBA vendor's management tool always does. PowerShell is quicker and works the same on every server.

Does Get-InitiatorPort need admin rights?

Run it from an elevated PowerShell session. Without elevation it can return incomplete results.

Does this work on Windows Server Core?

Yes. Everything above works on Server Core and over PowerShell remoting.

Related: Finding VMs with a fixed or round-robin multipath policy · Run EMC Grab for ESXi hosts