Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a requirement to create a content source of type "web" with the option "Only crawl within the server of each start address" via powershell. I am trying the below command : New-SPEnterpriseSearchCrawlContentSource -SearchApplication -Type Web -name Sample -StartAddresses <>

The problem is it is always selecting the third option "Custom - specify page depth and server hops". Is there any specific parameter or anything that I am missing.

Thanks in Advance!!

share|improve this question
add comment

1 Answer 1

This is by default set to "Custom - specify page depth and server hops:"

Because tweaking this option with Page Depth and Server Hops should help you to get the same effect as the other two options.

For eg:- Setting MaxPageEnumerationDepth (Page Depth) to 0 and MaxSiteEnumerationDepth (Server Hops) to 0 should give you the second option "Only crawl the first page of each start address".

Thus to get your first option, you would have to put the Powershell like this -

$searchapp = Get-SPEnterpriseSearchServiceApplication "Search Service Application" 
New-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchapp -Type Web -name Sample -StartAddresses SiteURL -MaxSiteEnumerationDepth 0
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.