1

I am running the PowerShell script below to change the search center url on my site collection. After I run the script, I go to the UI and see that the checkbox is enabled to inherit the search center settings. But in my script I set this checkbox on false.

        $site = Get-SPSite https://myCompany.com
        $web = Get-SPWeb $site.Url        
        $web.AllProperties["SRCH_SB_SET_SITE"] = '{"Inherit":false,"ResultsPageAddress":"{SearchCenterURL}/SearchResultsAll.aspx,"ShowNavigation":false}'
        $web.AllProperties["SRCH_ENH_FTR_URL_SITE"] = '/Paginas'
        $web.Update();

enter image description here

1

Central Admin displays Farm-level settings, but you're changing the settings for a specific SPWeb. If you'll take a look at https://spsamer.com/2013/07/22/sharepoint-2013-csom-property-bag-properties/, you can see all the different properties that can be set, including three different options for the Search Center URL:

Search Center URL

KEY: SRCH_ENH_FTR_URL

TYPE: string:RelPath

VALUE EXAMPLE: /sites/xyz/SearchCenter/Pages

Search Center URL (SITE)

KEY: SRCH_ENH_FTR_URL_SITE

TYPE: string:RelPath

VALUE EXAMPLE: /sites/xyz/SearchCenter/Pages

Search Center URL (Web)

KEY: SRCH_ENH_FTR_URL_WEB

TYPE: string:RelPath

VALUE EXAMPLE: /sites/xyz/SearchCenter/Pages

Still, you won't be able to update the Central Admin settings by changing a property on a single SPWeb, and I'm not sure exactly where the global property (SRCH_ENH_FTR_URL) would need to be set. Possibly on the Central Admin RootWeb?

1
  • But in the ui it is possible to configure this on sitecollection level. I expect that it is also possible in powershell.
    – Ola
    Mar 23 '17 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.