SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.