Connect-IscsiTarget AuthenticationType parameter is case sensitive RRS feed

  • General discussion

  • Hi Folks:

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

    The documentation at '' for the parameter reads:

    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 '' 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


    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!!


    Wednesday, March 5, 2014 3:55 PM

All replies

  • Thanks for your sharing!


    Yan Li

    Regards, Yan Li

    Friday, March 7, 2014 1:58 AM
  • 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, 



    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.



    AuthenticationType      : NONE
    InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
    InitiatorNodeAddress    :
    InitiatorPortalAddress  :
    InitiatorSideIdentifier : 400001370002
    IsConnected             : True
    IsDataDigest            : False
    IsDiscovered            : True
    IsHeaderDigest          : False
    IsPersistent            : True
    NumberOfConnections     : 1
    SessionIdentifier       : ffffe00000a14430-4000013700000032
    TargetNodeAddress       :
    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!!


    Wednesday, March 19, 2014 1:37 PM