I am trying to retrieve the site collections list from a SharePoint Online domain.
I am using C# and client object model.
The following code returns only 300 site collections.
var tenant = new Tenant(ctx);
spp = tenant.GetSiteProperties(0, true);
ctx.Load(spp);
ctx.ExecuteQuery();
Any idea on how to retrieve ALL site collections with CSOM ?
Thanks
Best Answer
I found the answer to this question,
the first parameter of the method GetSiteProperties is the index from which site collection retrieval starts.
I tried the the following command spp = tenant.GetSiteProperties(300, true);
which returned site collections from index 300.
So here is my code to get all site collections from sharepoint online
By the way, site collections are currently limited to 10000.