none
Connect-IscsiTarget AuthenticationType parameter is case sensitive

    General discussion

  • Hi Folks:

    The 'AuthenticationType' parameter of the Connect-IscsiTarget cmdlet must be UPPERCASE to work.

    The documentation at 'http://technet.microsoft.com/en-us/library/hh826098.aspx' for the parameter reads:

    -AuthenticationType<String>
    Specifies the type of authentication to use when logging into the target. Valid values are None (the default), OneWayCHAP, and MutualCHAP.

    Entering the values as written for OneWayCHAP and MutualCHAP returns an authentication error. However, if the values are entered in uppercase ONEWAYCHAP and MUTUALCHAP, the cmdlet succeeds. Bruce Langworthy's article 'Managing iSCSI Initiator connections with Windows PowerShell on Windows Server 2012' at 'http://blogs.msdn.com/b/san/archive/2012/07/31/managing-iscsi-initiator-connections-with-windows-powershell-on-windows-server-2012.aspx' provided insight into the problem when he specified the authentication type as ONEWAYCHAP instead of mixed case. The problem occurs in both PS versions 3.0 and 4.0.

    Side Note: The command New-IscsiTargetPortal also uses the 'AuthenticationType' parameter and appears to work when a mixed-case authentication type is passed (as documented).

    Here's how to replicate the problem

    PS> get-iscsitarget | connect-iscsitarget -targetportaladdress fd8e:c88b:b9d7:1::58 -ispersistent $true -initiatorportaladdress fd8e:c88b:b9d7:0001:0000:0000:0000:0061%0 -authenticationtype MutualCHAP -chapusername vApps -chapsecret <mysecret> -ismultipathenabled $true

    connect-iscsitarget : Authentication Failure.
    At line:1 char:19
    + get-iscsitarget | connect-iscsitarget -targetportaladdress fd8e:c88b:b9d7:1::58  ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (MSFT_iSCSITarget:ROOT/Microsoft/...SFT_iSCSITarget) [Connect-IscsiTarget], CimException
        + FullyQualifiedErrorId : HRESULT 0xefff0009,Connect-IscsiTarget

    # Entering authentication type in uppercase
    PS> get-iscsitarget | connect-iscsitarget -targetportaladdress fd8e:c88b:b9d7:1::58 -ispersistent $true -initiatorportaladdress fd8e:c88b:b9d7:0001:0000:0000:0000:0061%0 -authenticationtype MUTUALCHAP -chapusername vApps -chapsecret <mysecret> -ismultipathenabled $true

    Succeeds!

    I reported this to Microsoft Connect, but thought I'd post it on this forum in case someone else runs into this same issue. Confirmation of the problem would be appreciated. Thanks!

    Have a GREAT DAY!!

    Shaun  

    Wednesday, March 05, 2014 3:55 PM

All replies

  • Thanks for your sharing!

    Regards,

    Yan Li


    Regards, Yan Li

    Friday, March 07, 2014 1:58 AM
    Moderator
  • Hi Shaun, 

    Thanks for sharing. I have issue with isMultipathenable and isPersistent: I put $true but the output of get-iSCSISession is always false for Ispersistent. BTW I can't see ismultipathenable on the output of get-iSCSIsession.

    Please advise, 

    Thanks, 

    Agus

    Wednesday, March 19, 2014 8:23 AM
  • Additional information:

    - I am using windows 2012 R2 with latest update.

    - here is the output, as you can see there is no IsMultipath Enable parameter.

    Thanks

    Agus

    AuthenticationType      : NONE
    InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
    InitiatorNodeAddress    : iqn.1991-05.com.microsoft:db-srv-00.dvb-rcs.com
    InitiatorPortalAddress  : 10.3.1.2
    InitiatorSideIdentifier : 400001370002
    IsConnected             : True
    IsDataDigest            : False
    IsDiscovered            : True
    IsHeaderDigest          : False
    IsPersistent            : True
    NumberOfConnections     : 1
    SessionIdentifier       : ffffe00000a14430-4000013700000032
    TargetNodeAddress       : iqn.1986-03.com.hp:storage.p2000g3.1227152a51
    TargetSideIdentifier    : ab01
    PSComputerName          :

    Wednesday, March 19, 2014 12:49 PM
  • Hi Agus:

    Get-IscsiTarget is being piped into Connect-IscsiTarget cmdlet where the IsMultipathEnabled parameter is being set. Take a second look--it's easy to miss since the statement tends to be rather wordy with all the parameters. Hopefully that helps.

    Have a GREAT DAY!!

    Shaun 

    Wednesday, March 19, 2014 1:37 PM