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