Search code examples
windowspowershelliscsi

Get target IP address of an iscsi device from Windows Server


We have tape libraries connected via iSCSI to our Windows servers. I'm curious if there's any way at all to retrieve the IP address of the connected device.

I'm able to retrieve the TargetNodeAddress with the Get-IscsiSession command.. however, it doesn't return a DNS name or IP address. Already tried looking for it via the iSCSI gui, but I couldn't find it there either.

BTW: I found the stackoverflow post below that shows how to do this via linux, not Windows:

StackOverflow: Get target IP address of an iscsi device


Solution

  • Instead of Get-IscsiSession simply use Get-IsciConnection which contains a TargetAddress property.

    ConnectionIdentifier : ffff8a0133d5b010-0
    InitiatorAddress     : 0.0.0.0
    InitiatorPortNumber  : 194
    TargetAddress        : 10.0.0.254
    TargetPortNumber     : 3260
    PSComputerName       : 
    

    I do not have a tape device to test with but assume the same would be true for those as well.