Forum Discussion
Cannot Delete Search Service Application on SharePoint Server
Hi there,
We have a SharePoint farm with 2 FE and 2 App+Search configuration. We tried to delete the search service application from central admin using Farm admin credentials. It takes very long time to process and finally timeouts.
We have checked that it deleted the Search service databases and search service application proxy service. However, the main search service application is still present.
We have run the following commands from powershell, but all gets stuck without completion and no error is received.
Remove-SPEnterpriseSearchServiceApplication -Identity xxxx-xxxx-xxx-xxx-xxx
stsadm -o deleteconfigurationobject -id "xxxx-xxxx-xxx-xxx-xxx"We even tried to clear the one-time timer jobs and tried again, but no luck.
$farm = Get-SPFarm
$disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
if ($disabledTimers -ne $null)
{foreach ($timer in $disabledTimers)
{
Write-Host "Timer service instance on server "
$timer.Server.Name " is not Online. Current status:" $timer.Status
Write-Host "Attempting to set the status of the service instance to online"
$timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online
$timer.Update()
}
}The strange thing is that when we try to create a new search service application on central admin using farm credentials, it still timeouts and no service is created. Kindly help to fix this problem
1 Reply
- KashDieselIron Contributor
1. To check dependencies: Open the SharePoint Admin Center.
Navigate to Application Management > Manage Service Applications.
Check if the search service application is referenced by other services or applications.
2. Remove using PowerShell: Open SharePoint Management Shell (with administrator privileges).
Run the following command to get the ID of the Search Service application:
powershell
Get-SPServiceApplication
Run the following command to remove the Search Service application:
powershell
Remove-SPServiceApplication -Identity <ServiceApplicationID
3. Clear isolated objects: Open the SharePoint Management Shell (with administrator privileges).
Run the following command to clear isolated objects: powershell
Get-SPServiceApplication | Where-Object {$_.Name -eq “<SearchServiceApplicationName>”} | Remove-SPServiceApplication
4. Restart the SharePoint service:
Open the Services administrative tool.
Restart the following services:
SharePoint Administration
SharePoint Timer Service
SharePoint Search Host Controller