About Me

SharePoint Architect with over 17 years of IT Experience in various roles as SharePoint Architect, Administrator, Technical Architect, IT Analyst, Application Developer, CRM Consultant, BI Developer, Microsoft Solution Architect in Client/Server, Web and Enterprise CRM Applications in E-Commerce, Financial, Healthcare, Insurance, Telecom, Outsourcing and Technology Services.
MCITP (Pro): Microsoft Certified IT Professional: SharePoint 2010 Administrator.
MCTS: Microsoft Certified Technology Specialist, SharePoint 2010 Configuration.

Thursday, October 18, 2012

Enumerate Crawl Properties using Powershell

1. Save the following script file as      Get-EnumCrawlProp.ps1
2. Create an input file for Content Sources (just one content source name in one line)
3. Run the script as      PS>Get-EnumCrawlProp.ps1 ProdContentSources.txt

param(
[String]$InputFile = ""
)
If ($InputFile)
{
$ContentSrc = Get-Content $InputFile
$searchapp = Get-SPEnterpriseSearchServiceApplication |where {$_.name -eq "ProdSearchSA1"};
ForEach ($c in $ContentSrc)
{
 $csource = Get-SPEnterpriseSearchCrawlContentSource $c -sea $searchapp;
 #Write-Host "Crawl State for $c " $csource.CrawlState
 $csource.IncrementalCrawlSchedule | select DaysOfWeek, DaysInterval,  StartHour, StartMinute, RepeatInterval, RepeatDuration
}
"Process complete."
}

No comments:

Post a Comment