-1

I unfortunately did not add /pages to my url, so the search function doesn't work for me. I couldn't find a way to do it without using a powershell terminal. The solution that I found was this :

$ssa = Get-SPEnterpriseSearchServiceApplication
$ssa.SearchCenterUrl = <newURL>
$ssa.Update()

The problem is that this command doesn't run in my powershell.

The term Get-SPEnterpriseSearchServiceApplication is not recognized as 
the name of a cmdlet, function, script file, or operable program.

I have admin rights from that account in all the servers.

  • 1
    Have you added the sharepoint cmdlets? add-pssnapin microsoft.sharepoint.powershell – Christoffer Jun 30 '14 at 12:04
  • The SharePoint PowerShell snapin is installed with the SharePoint installation. The cmdlets can only be run on a SharePoint server and target the farm that the server is connected (so you cannot use the cmdlets to control another farm that the server is not a part of). I am running commands on the server. – el94 Jun 30 '14 at 12:06
  • 1
    You need to run the script from the sharepoint server where your search application is running on, should be the same server where your central admin is. – Christoffer Jun 30 '14 at 12:07
2

I think that i answered the same question here: How to use associate Search Center with Search Box?

However, make sure to run powershell as admin, and add the sharepoint cmdlets by typing add-pssnapin microsoft.sharepoint.powershell before trying to update the search center. Make sure that you run the command from the server where Central admin is running. If you only got one application server, that's the one.

To clear things up a little bit:

  1. Log into your server where central admin is running.
  2. Open up and run PowerShell ISE as an administrator.
  3. Type Add-pssnapin microsoft.sharepoint.powershell. Execute.
  4. Type Get-spserviceapplication | ft typename . This will return the name of all your service applications. Look for name of your search application.
  5. Copy the name of your search application, for example "Search Service Application"
  6. Copy the code into the script panel. ( ctrl + r ) if it's missing.
  7. Execute the script.

Example:

$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$ssa.SearchCenterUrl = "http://url/site/searchcentername/Pages/"
$ssa.Update() 

On the other hand you should be able to just update your preferred search center from the search application page in central admin.

To do it from central admin, open central admin, click Application Management, then manage service applications, and then click on your search service application and click the URL from Global Search Center URL.

enter image description here

  • IT doesn't work Error : "Get -SPEnterpriseSearchServiceAlllication : SearchApplication service not found " – el94 Jun 30 '14 at 12:42
  • If you only run Get-spserviceapplication | ft typename you should get the name of your search service application. – Christoffer Jun 30 '14 at 12:43
  • I am using SP 2013 so I suppose it is installed along with sharepoint. Windows 2012 r2 server. It just returns the error not the name of the server. – el94 Jun 30 '14 at 12:44
  • You should try to update your search url from central admin instead. Let me update my answer. – Christoffer Jun 30 '14 at 12:47
  • Did you solve it? :) – Christoffer Jun 30 '14 at 13:00
2

Your PowerShell cannot find the cmdlet 'Get-SPEnterpriseSearchServiceApplication'. You either need to reference the Sharepoint.PowerShell namespace before you call the cmdlet or use the SharePoint Management Shell.

Add-PSSnapin -Name Microsoft.SharePoint.Powershell
$ssa = Get-SPEnterpriseSearchServiceApplication
$ssa.SearchCenterUrl = <newURL>
$ssa.Update()
  • I do not get an error in the first two lines,nor any message. In the third line i get the error "the < operator is reserved for future use" – el94 Jun 30 '14 at 12:19
  • That's because of the parameter -ErrorAction -SilentlyContinue that tells Powershell to finish even if there's errors. That's why you don't get anything. – Christoffer Jun 30 '14 at 12:21
  • 2
    Look at the link user19952 posted. And try leaving out the '-Error SilentyContinue' argument. – MertenK Jun 30 '14 at 12:24
  • <newurl> should be replaced with the URL of the search center you're looking to use. Don't enter <newurl> verbatim. – shufler Oct 9 '14 at 16:26
1

If you look at your Search Service Application page and NEED TO UPDATE AN INCORRECT GLOBAL SEARCH CENTER URL, it looks like it is not updatable from this page, but actually it is! You do not need to use PowerShell, if you are a Farm Admin, you can update the URL in that page. If you click on the incorrect Search Center link, it gives you a dialog where you can update the URL. (Poor UI design Microsoft, page design makes it look like you can't update it, but you can).

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.