Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
I found an easy way to get the list of Sites and site collections just by using search. (No Code or customization required.) Thanks Corey Roth's article - https://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/01/13/how-to-query-site-and-site-collections-using-sharepoint-search.aspx?utm\_source=feedburner\&utm\_medium=feed\&utm\_campaign=Feed%3A+CoreysDotNetTipOfTheDay+%28Corey+Roth+-+DotNetMafia.com%29
To achieve this we make use of the managed property : ContentClass.
Simply put the text - contentclass:"STS_Web" in the search box and hit enter. You will get the list of all the sites in your farm (Or web applications serviced by that search service application) But this doesnt return any root sites.
To get even root sites, just change the text to contentclass:"STS_Site" contentclass:"STS_Web"
In my case, I’ll restrict the URL to web application.
contentclass:"STS_Site" contentclass:"STS_Web" site:<Url of web application>
Anonymous
January 18, 2012
fabulous .. i was lokking for this ..
Anonymous
December 14, 2012
Thanks for posting this! Very Nice SharePoint feature!
Anonymous
June 12, 2014
Useful Information. Thanks for the effort.
Anonymous
March 11, 2015
It returns only publishing subsite,not all subsites.Any Idea?
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in