Forum Discussion

StefanoC66's avatar
StefanoC66
Iron Contributor
May 19, 2025

FC Target discovery

I was looking for a way to discover FC targets for each initiator.

Searching on the web I found this code

# Get all initiator ports (HBA ports)
$initiatorPorts = Get-InitiatorPort

# Loop through each initiator port and list its targets
foreach ($port in $initiatorPorts) {
    Write-Host "Initiator Port: $($port.NodeAddress) - $($port.PortAddress)"
    $targets = Get-InitiatorTarget -InitiatorPortAddress $port.PortAddress
    foreach ($target in $targets) {
        Write-Host "  Target: $($target.NodeAddress) - $($target.PortAddress)"
    }
}

But is not working because the Get-initiatortarget is not recognized as valid command.

Is there a way I can do it 

thanks

 

Resources