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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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