stsadm command not accepting

Tevon2.0 1,106 Reputation points
2023-10-18T20:31:49.9033333+00:00

What is the error in this command? how should I go about executing this intended command "

stsadm.exe -o spsearch -farmcontentaccessaccount CONTOSO\ServiceAccount –farmcontentaccesspassword NewPassword

PS C:\Users\tking.RE-DEK> stsadm.exe -o spsearch -farmcontentaccessaccount RE-DEK\sp_farmadmin -farmcontentaccesspassword '123456789'

Command line error.


Usage:
           stsadm.exe -o <operation> [<parameters>]
           stsadm.exe -help [<operation>]

Operations:


           activatefeature
Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint Server | Development
SQL Server | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Iohann Gessenay 166 Reputation points
    2023-10-18T20:59:13.7366667+00:00

    Parameter Hyphens: Sometimes, the hyphen character can be an issue, especially if you're copying and pasting the command from a formatted document or a web page. The hyphen might be a non-standard character, like an en dash or an em dash. Type out the command manually or ensure you're using standard hyphens.

    Parameter Spacing: Ensure there's a space between each parameter and its value, and between different parameter-value pairs.

    Quotes: Try removing the single quotes around the password and see if that resolves the issue.

    Version Specific: Some parameters or operations could be version-specific. If you're using a version of SharePoint where the parameters you're using are not applicable, it will throw an error. Check the documentation specific to your SharePoint version.


  2. Emily Du-MSFT 51,836 Reputation points Microsoft External Staff
    2023-10-19T06:42:22.6833333+00:00

    Here are two methods to change default content access account.

    1.SharePoint Central Admin -> Application Management -> Manage Service applications -> Search service application -> On the Search Administration page, click the account already configured for the default content access account -> Provide the new crawl account username and password.

    2.Use PowerShell.

    Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
     
    #Set Default content access account
    $AccountID = "Crescent\SP19_Crawl"
    $Password = Read-Host -AsSecureString 
     
    #Get Search service application
    $SearchInstance = Get-SPEnterpriseSearchServiceApplication
     
    #Set default content access account for crawl
    Set-SPEnterpriseSearchServiceApplication -Identity $SearchInstance -DefaultContentAccessAccountName $AccountID -DefaultContentAccessAccountPassword $Password
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.