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!!

link|improve this question
feedback

1 Answer

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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