Powershell: Get LUN name of a connected iSCSI Device

Answered Powershell: Get LUN name of a connected iSCSI Device

  • Thursday, November 22, 2012 8:18 AM
     
     

    Hi,

    how can I get the real name (of the LUN) of the connected iSCSI "disk" with powershell?

    Windows storage server 2008 R2 has a powershell module which can do that, but how can I get similar functionality without it?

    http://blogs.technet.com/b/josebda/archive/2010/09/29/powershell-cmdlets-for-the-microsoft-iscsi-target-3-3-included-in-windows-storage-server-2008-r2.aspx

    I could not find a wmi MSiSCSI class with the information I was looking for.

    The Result should look like this:

    Id                          : Server0.contoso.local:FileCluster
    TargetName                  : FileCluster
    TargetIqn                   : iqn.1991-05.com.microsoft:server0-filecluster-target
    Description                 : Storage for File Server Cluster
    Enable                      : True
    Status                      : Connected
    ComputerName                : Server0.contoso.local
    InitiatorIds                : {IPAddress:192.168.100.1, IPAddress:192.168.100.2}
    LunMappings                 : {TargetName:FileCluster;WTD:0;LUN:0, TargetName:FileCluster;WTD:1;LUN:1}   # THIS IS THE INFO I'M ASKING FOR
    Version                     : 3.3.16543
    ServerInfo                  : Server0.contoso.local

    Best Regards


    ..next time we eat bacon



    • Edited by exit1337 Thursday, November 22, 2012 9:05 AM
    • Edited by exit1337 Thursday, November 22, 2012 9:07 AM
    •  

All Replies