Forum Discussion
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
1 Reply
Where did you find that script example? I would expect it to be in the Storage built-in module, but it's not. Is it a function, perhaps?