我的代码:
SPOSitePropertiesEnumerable spp = null;
Microsoft.Online.SharePoint.TenantAdministration.Tenant tenant = new Tenant(clientContext);
int startIndex = 0;
while (spp == null || spp.Count > 0)
{
spp = tenant.GetSiteProperties(startIndex, true);
clientContext.Load(spp);
clientContext.ExecuteQuery();
foreach (SiteProperties sp in spp)
{
Response.Write("<br/> All Sites Collection: " + sp.Title + "<br/>");
// siteCols.Add(new SiteCol(sp.Title, sp.Url));
// startIndex = siteCols.Count;
}
startIndex++;
}
我收到此错误:方法 Microsoft.SharePoint.Client.ClientRuntimeContext.Load:类型参数“Microsoft.Online.SharePoint.TenantAdministration.SPOSitePropertiesEnumerable”违反了类型参数“T”的约束
有没有其他方法可以检索所有网站集?