Sorry, something went wrong while browsing to the Central Administration: Parameter name: encodedValue

We encountered the “Sorry, something went wrong” while browsing to the Central Administration of a SharePoint 2013 environment. We analyzed the logs using the ULSViewer and found the following errors referenced by the correlation ID.

Application error when access /, Error=Exception of type ‘System.ArgumentException’ was thrown. Parameter name: encodedValue at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers)  at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea)  at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

System.ArgumentException: Exception of type ‘System.ArgumentException’ was thrown. Parameter name: encodedValue  at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers)  at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea)  at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Getting Error Message for Exception System.ArgumentException: Exception of type ‘System.ArgumentException’ was thrown. Parameter name: encodedValue  at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)  at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers)

There are a few blogs regarding this issue on the web which mentions it occurs due to a misconfiguration in FBA (Forms Based Authentication). We do not have FBA enabled for our Central Administration but the error indicates that’s something is wrong with the authentication as it specifies the SPClaimEncodingManager. There are a few possible solutions to fix this issue where number 3 has resolved it for us.

  1. First try to resolve this issue by restarting IIS or the server to verify it doesn’t have something to do with the servers memory or cache as “resetting” the server may sometimes solve the issue.
  2. It may have something to do with the IIS authentication settings for the Central Administration where it should look like the below
  3. In our case it was the way the Central Administration was setup at the customer. The SharePoint Central Administration icon navigates us to http://admin.<domain>.local but the link doesn’t add the port behind the URL where it was configured to 2720 in the Internet Information Services. We were able to connect to http://localhost:2720 and also when we used http://admin.<domain>.local:2720.You can change the Central Administration URL of the icon to match the configured IIS binding by editing the registry. Follow the following steps to modify the correct key:
    – First backup the registry just to be sure
    – Navigate to HKEY_LOCAL_MACHINE -> Software > Microsoft -> Shared Tools -> Web Server Extensions -> 14.0, 15.0 or 16.0 depending on your version -> WSS
    – Change the “CentralAdministrationURL” value to the correct URL

    The icon now redirects to the correct URL:

Grant user account Farm Administrator permissions with PowerShell

We had an “unexpected” issue at a customer which I troubleshooted. I was unable to connect to the Central Administration and I tried to add my account to the Farm Administrators group using PowerShell as a possible solution. The issue occurred on a SharePoint 2013 environment but the below screenshots have been taken from a SharePoint 2019 environment.

First start the SharePoint 2019 Management Shell as administrator

Use the below commands to retrieve the current Farm Administrators

$WebApp = get-spwebapplication -includecentraladministration | where-object {$_.DisplayName -like "SharePoint Central Administration*"}
$Web = Get-SPweb($WebApp.Url)
$FarmAdminGroup = $Web.SiteGroups["Farm Administrators"]
$FarmAdminGroup.users

Next run the following commands to add the user to the Farm Administrators group.

$user = "Domain\UserID"
$FarmAdminGroup.AddUser($user, "", $user, "")

You can run the following commands again to retrieve the list of current Farm Administrators.

$FarmAdminGroup = $Web.SiteGroups["Farm Administrators"]
$FarmAdminGroup.users