Saturday, April 4, 2015

SharePoint 2013: Set-SPEnterpriseSearchServiceApplication : Content source access username or password is not valid.

Problem

You are nearly completed with the scripted installation of a new Search service.  You execute the last command,

Set-SPEnterpriseSearchServiceApplication –Identity $SearchApp -ApplicationPool $QueryAppPool -DefaultContentAccessAccountName $CAAcct -DefaultContentAccessAccountPassword $CAAcctPW

where $CAAcct is the content access service account and $CAAcctPW is the encrypted form of the content access service account password.  However, you see this error message:

Set-SPEnterpriseSearchServiceApplication : Content source access username or 
password is not valid.
At line:1 char:1
+ Set-SPEnterpriseSearchServiceApplication -Identity $SearchApp -ApplicationPool 
$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: 
(Microsoft.Offic...viceApplication:SetSearchServiceApplication) 
[Set-SPEnterpriseSearchServiceApplication], ArgumentException
   + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet
    .SetSearchServiceApplication

You check the content access service account, spContent, and verify that the password you scripted is the correct one in your records.  For this posting, let it be "Pas$word".  You try resetting the password, and then re-running the command, but it returns the same error message.  You then try executing the command using the unencrypted form of the password.  This time, you see this error present:

Set-SPEnterpriseSearchServiceApplication : Cannot bind parameter 
'DefaultContentAccessAccountPassword'. Cannot convert the "Pas" value of type 
"System.String" to type "System.Security.SecureString".
At line:1 char:172
+ ... ccountPassword $password
+                    ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) 
[Set-SPEnterpriseSearchServiceApplication], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,
Microsoft.Office.Server.Search.Cmdlet.SetSearchServiceApplication

You note that only the first characters before the "$" are shown in this error message.  You then reconfigure the account with the same password, substituting the "$" with a "-".  This time, the command executed successfully.

Solution
  • When building a search service application, do not configure the search content access service account password with a "$".
References

No comments: