Clean up – Search Service Application in SharePoint 2013

Well you faced something went wrong and looks that you could not able to delete search service Application correctly. In this article’s purpose¬† demonstrate which components we have using for a Search Service Application

Ok Lets break our Search Service Application .Well don’t try¬†this on a production ūüôā¬†I assume that you have a completely running Search Service Application and will break it to test purpose
Open a sharepoint powershell console and type

$SSA = Get-SPEnterpriseSearchServiceApplication
(if you have more than one SSA you need to change parameters to get the correct one)
CleanSSA1

So lets create a scenario that someone we assume has deleted our good SSA like

$SSA.Delete()

CleanSSA2

+Upps In this condition you have a big problem. Because deleting the object of the service app itself is not a correct action . It clears the Service Application Object but Search Service Application have many other components (IIS Web Service,Timer Jobs ,DBs etc)  and they are still remains. Unfortunately there is no warning when you did it.
If you really want to remove a Service Application , you have to use Remove-SPServiceApplication cmdlet, not call the related object’s delete method.

So define what is remaining we have to know what components are we installing when you provision a Search Service Application

-We have creating a IIS Web Site under SharePoint Web Services Site.
-We have creating 8 Timer jobs for every SSA.

  • “Search Custom Dictionaries Update for Search Application <guid of SSA>”
  • “Crawl Log Cleanup for Search Application <guid of SSA>”
  • “Rebalance crawl store partitions for <guid of SSA>”
  • “Usage Analytics Timer Job for Search Application <guid of SSA>”
  • “Spelling Customizations Upgrade for Search Application <guid of SSA>”
  • “Spelling Dictionary Update for Search Application <guid of SSA>”
  • “Analytics Timer Job for Search Service Application <guid of SSA>”
  • “Query Classification Dictionary Update for Search Application <guid of SSA>”

-In a usual way we have creating a Search Service Application Proxy
-And that Proxy consumed by several Web Applications .
-And a Search Administration Web Service (We are using this for Crawl operation, Crawl component is not a FAST Search related part and not runs under noderunner.exe process .

Actions:
Well the supported action for this scenario is return from Backup by Microsoft!
But if you want to get a clean state on a test env you may try this;

1) Remove the Search Service DB’s
CleanSSA3
2) Open IIS and find Search Service Related web sites under SharePoint Web Services , locate and delete only the related search service site.
CleanSSA6
3) Clean up all SSA Connections on Web Application level.
-Open the Central Administration -> Manage Web Application -> Select Web Application -> Click to Service Connections on the ribbon
CleanSSA5
4) Remove if SSA Proxy still available
CleanSSA4
5) Remove Search Administration Web Service Application if exists

6) Clear the timer jobs belong to deleted SSA .(Otherwise they will make a log noise with critical exceptions )
(I accept this can create some concequences and you may not able to delete some remaining timer-jobs very easily in some scenarios but at least you can disable them.)
Well totally clear it , you may need to open a case to Microsoft.

Even so there are many objects still remains in SharePoint_Config database. Directly deleting from database is an unsupported operation!

 

Advertisements

Unable to delete Search Service Application (SSA) in SharePoint 2010

Hello,

If you have a bull headed Enterprise Search Service Application and you can not able to delete this service application by Central Administration or fallowing powershell script
$ssa = Get-SPServiceApplication -name “<Search Service Application¬† Name>”
Remove-SPServiceApplication $ssa

The symptoms is when you attempt to  delete this service application powershell or web GUI is hanging  until timeout.

So you may try fallowing powershell command to force to delete:

1) Open the SharePoint PowerShell on the SharePoint server and run the following commands:
2) Run fallowing command which will list all Enterprize search applications and their GUIDs
Get-SPEnterpriseSearchServiceApplication
Take note of problematic service application guid
3) Type fallowing command:
$ssa = Get-SPEnterpriseSearchServiceApplication -id “<noted guid here>”
$ssa.unprovision(1)

if the above command is successful the SSA will be deleted, if it is hung, then try fallowing:
1) Open a new PowerShell:
2) Run fallowing command which will list all Enterprize search applications and their GUIDs
Get-SPEnterpriseSearchServiceApplication
Take note of problematic service application guid

$ssa = Get-SPEnterpriseSearchServiceApplication -id “<noted guid here>”
$ssa.Delete()

I hope this will resolve your issues.

MOSS 2007 – Search “The gatherer is shutting down” error

When try to open search setting page if you are getting fallowing error :
The gatherer is shutting down. at Microsoft.SharePoint.Portal.Search.Admin.Pages.SearchAdminPageBase.ErrorHandler(Object sender, EventArgs e)
at Microsoft.SharePoint.Portal.Search.Admin.Pages.SearchSSPAdminPageBase.OnError(EventArgs e)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP._layouts_searchsspsettings_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously

Possibly you have¬†a hang issue on one of your WFE server’s¬†Office Server Search service.
1) Check your topology from Central Administration Р> Servers in Farm section and define which SharePoint servers responsible for running search.
2) Connect all that machines and open services.msc and check status of Office Server Search Service.
3) If you find a service in “stopping” state open a task manager
4) kill the mssearch.exe process¬†.after¬†killing this process¬†your Office Server Search service¬†should go “stop” state.
5) Restart the service and check does your problem has been fixed.

Also restarting server¬†can fix this problem¬†but¬†if you don’t want to restart¬†you can fallow up above solution.

Powershell find files with versions.

If you are searching all same files and versions in your drive you can user fallowing powershell command:

get-childitem -Recurse | where-object { $_.Name -eq “Microsoft.Sharepoint.ApplicationPages.dll” } |%{ $_.VersionInfo }| select * > c:\FileVersions.txt

Sharepoint 2010 Publishing Portal and missing Search Center template

Hi everybody, last day one of my friend called me and asked ” i provision a Publishing portal template but i couldn’t found Search Center Templates do you know where are they?” If you encounter with this situation Dont panic they are already there but ¬†in sharepoint 2010 when provisioning Publishing Portal and Enterprise Wiki templates other templates administratively disabled by default .You can activate them ¬†from Site Actions->Site Settings -> (Look and Feel) Page layouts and site templates

Happy tips & tricks