I'm creating low-trust addin for sharepoint and trying to get list of all site collections using CSOM. This code works good for SharePoint Online:

using (var context = GetAppOnlyClientContext(hostUrl)) 
   var tenant = new Tenant(context); 
   var siteProperties = tenant.GetSiteProperties(0, true); 


   var result = siteProperties.ToList(); 

But when I'm trying to run this code on SP 2016 instance, I get following exception:

Cannot find stub for type with id {268004ae-ef6b-4e9b-8425-127220d84719}. The specified server may not support APIs used in this operation.

I'm using CSOM version 16.0.

So the question is: Can I receive list of site collection using CSOM? If yes, how can I avoid this error?


2 Answers 2


For 2016, you can follow the instructions here: https://blogs.msdn.microsoft.com/vesku/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom/

Except you need to make the following changes:

  1. You don't need step #1 since the update is already applied.
  2. For the powershell script, be sure to change the version is from 15 to 16.
  3. Skip step 3 since the dll's you have already include the needed references to create the sites.
  4. Run this command the same as is documented.

This method has finally been added in October 2016 PU.


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.