How to get result sources in SharePoint 2013/2016/2019 using Powershell?

Below are the powershell commands get result sources in SharePoint 2013/2016/2019 using Powershell.

Add-PSSnapin Microsoft.SharePoint.PowerShell
  
$ssa = Get-SPEnterpriseSearchServiceApplication
$fedman = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($ssa)
  
$searchOwner = Get-SPEnterpriseSearchOwner -Level Ssa  
$filter = New-Object Microsoft.Office.Server.Search.Administration.SearchObjectFilter($searchOwner)

$filter.IncludeHigherLevel = $true

$fedman.ListSources($filter,$true) | Select Name, Description, Active, Owner

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *