Quick Solution 1 : New-SPTrustedIdentityTokenIssuer Exception of type 'System.ArgumentException' was thrown

Error Message 

New-SPTrustedIdentityTokenIssuer: Exception of type 'System.ArgumentException' was thrown.

Parameter name: newObj

At line:1 char:33

+ New-SPTrustedIdentityTokenIssuer
<<<<  -Name "<name>"
-Description "<description>" -Realm <realm>
-ImportTrustCertificate <certificate> -ClaimsMapping <mappings>
-SignInUrl <url> -IdentifierClaim <IdentityClaim>
   
+ CategoryInfo : InvalidData: (Microsoft.Share...dentityProvider:SPCmdletNewSPIdentityProvider) [New-SPTrustedIdentityTokenIssuer],argumentException   
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPIdentityProvider

Causes 

The New-SPTrustedIdentityTokenIssuer will create a SPTrustedLoginProvider named newObj.

The error can occur in the following scenarios:

  • The newObj SPTrustedLoginProvider is null
  • The name(parameter Name) of the SPTrustedLoginProvider has been used
  • The length of the name(parameter Name) of the SPTrustedLoginProvider is larger than 50
  • The certificate(parameter ImportTrustCertificate) for the SPTrustedLoginProvider has been used

 

Solutions

In order to fix the issue, please ensure:

  1. The name of the SPTrustedLoginProvider is not been using
  2. The length of the name is less than 50
  3. The certificate is not been using