I have been spending a lot of time trying to automate the deployment of different Service Applications in SharePoint 2013 lately.
An issue I’m having unrelated to this blog post is trouble getting the Search Service Topology to show up. Getting the ole ‘Unable to retrieve topology component health states. This may be because the admin component is not up and running. (sorry if you searched on that and found this article, this isn’t a fix for that, maybe I’ll post an update if i get it sorted).
But my issue came while trying to trouble shoot the original topology problem. I went to wipe the slate clean but when I tried to delete the Search Service Application, I was able to delete the proxy and all the databases but the Search Service Application itself wouldn’t delete. All i got in PowerShell, stsadm as well as the UI was “The timer job completed, but failed on one or more machines in the farm.”
Turns out during my troubleshooting of the original problem i changed the service accounts that were running in the windows services for “SharePoint Administration” to a different account. As well I changed the “SharePoint Search Host Controller” to the farm account as well (thinking i was having a permissions issue with the topology).
When I changed them back to their default values I was able to delete the Service Applications.
Hope that helps.