Skip to main content
1 of 2

The duration is not exposed, however the start date/time is available under the crawl source property "CrawlStarted". With this, we can use the Get-Date cmdlet to get the current date/time and subtract the CrawlStarted date/time to find the duration. The following PowerShell can be used to print the duration to the console.

Add-PSSnapin microsoft.sharepoint.powershell

$sources = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service"
ForEach ($source in $sources) {
    if ($source.CrawlStatus -ne "Idle") {
        Write-Host ((Get-Date) - $source.CrawlStarted)
    }
}