提供现代SharePoint在线团队网站
问题描述:
大家好,
答
您好,
您只需使用PnP CSOM代码配置SharePoint Online Modern Team站点:
You could simply provision SharePoint Online Modern Team site with PnP CSOM code:
// Let's use the CreateSiteAsync extension method of PnP CSOM Core
// to create the "modern" team site
var targetTenantUrl = "https://[tenant].sharepoint.com/";
using (var context = new ClientContext(targetTenantUrl))
{
context.Credentials = OfficeDevPnP.Core.Utilities.CredentialManager.GetSharePointOnlineCredential("[Name-of-Your-Credentials]");
// Create new "modern" team site at the url
// https://[tenant].sharepoint.com/sites/mymodernteamsite
var teamContext = await context.CreateSiteAsync(
new TeamSiteCollectionCreationInformation
{
Alias = "mymodernteamsite", // Mandatory
DisplayName = "displayName", // Mandatory
Description = "description", // Optional
Classification = "classification", // Optional
IsPublic = true, // Optional, default true
});
teamContext.Load(teamContext.Web, w => w.Url);
teamContext.ExecuteQueryRetry();
Console.WriteLine(teamContext.Web.Url);
}
更多信息:
Provisioning" modern"团队网站以编程方式
谢谢
最好的问候