SharePoint 2013 Search – Removing Inactive Search Topologies with PowerShell

Recently I had a need to get rid of some old search topologies on a customers’ SharePoint farm. I found this awesome line of PowerShell that does exactly that in one neat little package.

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq “Inactive”} |% {Remove-SPEnterpriseSearchTopology -Identity $_ -Confirm:$false};

Many thanks to Chris Rumel and his blog post (below).

http://sharepointstruggle.blogspot.ca/2012/07/sharepoint-2013-search-removing.html