Forum Discussion

Ralf Friedrich's avatar
Ralf Friedrich
Copper Contributor
Mar 14, 2018

How to get the site collection List using REST or CSOM?

Hi all,

 

we would like to get a list of all site collections using REST or CSOM with JavaScript. We used the REST call /_api/search/query? querytext=' contentclass: sts_site' &trimduplicates=false&selectproperties=' Title, SPWebUrl, WebTemplate, Description'", but not all site collections are returned.

Specially created site collections will not be returned. But even some of the site collections that have been created for a long time are not listed.


The call is done from a script in an Azure Web App. 

 

the current user is site collection administrator in all site collections.

 

Is there a reason for this?

And how can we solve this?

 

Regards,
Ralf

 

Resources