Вопрос

I want to display all site collections for a given web application(Can be hard-coded url) using JSOM SharePoint 2010(No REST api). I have tried but couldn't complete it.

Это было полезно?

Решение

The JS CSOM only operates on the site you are currently on (You can open another client context but you need a site URL to do so). It does not allow you to do any operations based on the webapp level. If you want to execute those statements you need to user other ways.

A nice and simple approach would be to query the search via REST. You can apply a filter to only retrieve Sitecollections and you can also filter by path.

A filter for Sitecollections can be don't via the contentclass managed property with a value of sts_site.

Have a look here for some values you can use:
https://blogs.msdn.microsoft.com/mvpawardprogram/2015/02/16/sharepoint-power-searching-using-contentclass/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top