以编程方式预配“新式”团队网站Provisioning "modern" team sites programmatically

2016 年秋季,SharePoint Online 中引入了“新式”网站,用户可以在租户级别控制如何使用此类网站。"Modern" sites were introduced in SharePoint Online during the autumn of 2016, and the option to use them can be controlled at the tenant level. 本文介绍了在 SharePoint Online 中预配“新式”网站的各种不同方法和注意事项。This article discusses the different options and considerations for provisioning "modern" sites in SharePoint Online. 特别是,本文介绍了如何创建“新式”团队网站和“新式”通信网站。In particular, the article covers how to create both "modern" team sites and "modern" communication sites.

重要

我们不会弃用“经典”体验;“经典”和“新式”体验将同时共存。We're not deprecating the "classic" experience; both "classic" and "modern" will coexist.

比较“新式”团队网站和“新式”通信网站Comparing "modern" team sites and "modern" communication sites

深入详细介绍如何预配“新式”网站前,我们先探讨一下两大类“新式”网站:团队网站和通信网站。Before digging into the details about how to provision "modern" sites, let's discuss a little bit about the two main flavors available: team sites and communication sites.

“新式”团队网站是一个可供一群人相互配合、协作、共享文档和消息的地方。A "modern" team site is a place where a group of people can work together, collaborate, and share documents and messages. 为了提升整体协作体验,每个“新式”团队网站都有后备 Microsoft 365 组。Every "modern" team site has a backing Microsoft 365 group to improve the overall collaboration experience. 实际上,得益于 Microsoft 365 组,团队成员可以从 Planner、共享日历、共享 OneDrive for Business 存储、自定义 Office 365 连接器等服务中受益。In fact, thanks to the Microsoft 365 group, members of the team can benefit from services such as Planner, a shared Calendar, a shared OneDrive for Business storage, and custom Office 365 connectors. 在“新式”团队网站中,成员通常可以参与改进内容(读/写)。In a "modern" team site, typically the members can contribute to the content (read/write). 此外,“新式”团队网站的后备 Microsoft 365 组可以是专用组,也可以是公用组;默认为公用组。Moreover, the Microsoft 365 group backing a "modern" team site can be private or public, and by default it is public.

“新式”通信网站是一个可供共享资讯、展示文章、广播消息的地方。A "modern" communication site is a place where you can share news, showcase a story, or broadcast a message. 通信网站旨在让少数几个编辑者创建和维护内容,而让大量受众使用内容。The idea of a communication site is to have few editors that create and maintain the content, and a wide audience that consumes that content. 不过,通信网站没有后备 Microsoft 365 组。However, a communication site does not have a backing Microsoft 365 group. 用户可以借助其他任何 SharePoint 网站的一组已知权限访问目标通信网站;默认情况下,每个通信网站都是专用网站。Users can access the target communication site with the well-known set of permissions of any other SharePoint site, and by default every communication site is private.

因此,如果需要创建支持团队协作的网站,那么理想之选最有可能是“新式”团队网站。Thus, if you have to create a site for team collaboration, most likely the "modern" team site is the right choice. 相反,若要向一大批人传达内容,那么最佳选择可能是通信网站。On the contrary, if you want to communicate something to a broad set of people, probably the communication site is your best choice.

预配“新式”团队网站Provisioning "modern" team sites

此部分将介绍如何预配“新式”团队网站,以及具体有哪些方法可供选择。In this section you learn how to provision a "modern" team site, and what the available options are to do that.

通过用户界面预配“新式”团队网站Provision a "modern" team site from the user interface

预配“新式”团队网站的途径有很多种。There are numerous routes for a "modern" team site to get provisioned. 可以直接从 SharePoint Online 网站启动预配,也可以从其他位置(例如,从 Outlook)预配 Microsoft 365 组,这之后也会触发预配“新式”团队网站。You can start the provisioning directly from the SharePoint Online site, or alternatively provision a Microsoft 365 group from other locations (for example, from Outlook), which then also triggers the provisioning of a "modern" team site.

  • 如果管理员在租户中启用了“新式”团队网站,则你可以通过 SharePoint 起始页创建“新式”团队网站。If your administrator enabled "modern" team sites in your tenant, you can create "modern" team sites from the SharePoint start page.

  • 也可以通过 Office 365 Outlook 创建 Microsoft 365 组。如果访问此组的“网站”选项卡,就会到达“新式”团队网站。You can also create a Microsoft 365 group from Office 365 Outlook, and when you access the site tab of that group, you land on a "modern" team site.

控制默认的预配流Control default provisioning flow

可以通过 SharePoint Online 管理设置来控制 SharePoint 网站的创建过程。You can control the SharePoint site creation process from the SharePoint Online admin settings. 可以选择是否为最终用户提供“新式”体验,或者选择你是否愿意继续使用“经典”体验。You can choose if the "modern" experience is available for your end users or if you'd like to continue using the "classic" experience.

SharePoint Online 管理 UI 中的“网站创建”选项

有关详细信息,请参阅以下 Office 支持文章:For more information, see the following Office Support article:

通过 SharePoint Online REST API 以编程方式预配“新式”团队网站Provision a "modern" team site programmatically via SharePoint Online REST API

可以使用 SharePoint Online 提供 REST API 以编程方式创建“新式”团队网站,这些网站也可供 SharePoint Online 的“创建网站”UI 使用。"Modern" team sites can be created programmatically by using a REST API provided by SharePoint Online, and also used by the Create Site UI of SharePoint Online. 若要通过 REST 预配“新式”团队网站,请对 Microsoft Graph“组”终结点发出 POST 请求:https://graph.microsoft.com/v1.0/groupsTo provision a "modern" team site via REST, make a POST request to the Microsoft Graph "groups" endpoint: https://graph.microsoft.com/v1.0/groups

“新式”团队网站的 URI 由 mailNickname 参数和在租户管理(这默认为“网站”)中为团队网站所选的托管路径决定。The URI of the "modern" team site is determined by the mailNickname parameter and the managed path you select for team sites in your tenant administration (this defaults to 'sites').

以下操作将创建 Microsoft 365 组和含有 URL https://[tenant].sharepoint.com/sites/mymodernteamsite 的关联的“新式”团队网站The following would create a Microsoft 365 group and an associated "modern" team site with a URL of https://[tenant].sharepoint.com/sites/mymodernteamsite

POST https://graph.microsoft.com/v1.0/groups
Content-type: application/json
Content-length: 200

{
  "description": "description",
  "displayName": "My modern team site",
  "groupTypes": [
    "Unified"
  ],
  "mailEnabled": true,
  "mailNickname": "mymodernteamsite",
  "securityEnabled": false
}

使用 PnP CSOM 核心组件预配“新式”团队网站Provision a "modern" team site by using the PnP CSOM Core component

在 SharePoint PnP 核心组件中—自 2017 年 10 月版本 (v.In the SharePoint PnP Core component—since the October 2017 release (v. 2.19.1710.1) 起—有适用于 CSOM ClientContext 类型的新扩展方法。2.19.1710.1)—there is a new extension method for the CSOM ClientContext type. 扩展方法名为 CreateSiteAsync,使用此方法在数秒钟内即可创建“新式”团队网站。The extension method name is CreateSiteAsync and allows you to create a "modern" team site in a matter of seconds.

下面的代码片段展示了如何使用此方法。In the following code snippet you can see how to use this technique.

// 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);
}

备注

可以在 SharePoint“新式”团队分类中找到有关 Classification 参数的更多详细信息。You can find further details about the Classification argument in SharePoint "modern" sites classification.

可以看到,此扩展方法会新建“新式”团队网站,并返回直接连接到新建网站的新 ClientContext 对象。As you can see, the extension method creates a new "modern" team site and returns a new ClientContext object directly connected to the newly created site.

使用 PnP PowerShell 预配“新式”团队网站Provision a "modern" team site by using PnP PowerShell

也可以使用 PnP PowerShell 创建“新式”网站。You can also create "modern" sites by using PnP PowerShell. 下面的脚本创建“新式”团队网站,并返回实际的 SharePoint 网站 URL 以供进一步控制。The following script creates a "modern" team site and then returns the actual SharePoint site URL for further manipulation. 有权访问已创建网站的 URL 后,便可使用 CSOM(包含 SharePoint PnP 核心组件)或 SharePoint PnP-PowerShell 对已创建网站自动执行其他操作。After you have access to the URL of the created site, you can use CSOM (with the SharePoint PnP Core component) or SharePoint PnP-PowerShell to automate other operations on the created site.

# Connect to SharePoint Online
# This command will prompt the sign-in UI to authenticate
Connect-PnPOnline "https://[tenant].sharepoint.com/"

# Create the new "modern" team site
$teamSiteUrl = New-PnPSite -Type TeamSite -Title "displayName" -Alias "mymodernteamsite" -Description "description" -IsPublic -Classification "classification" 

# Connect to the modern site using PnP PowerShell SP cmdlets
# Since we are connecting now to SP side, credentials will be asked
Connect-PnPOnline $teamSiteUrl

# Now we have access on the SharePoint site for any operations
$web = Get-PnPWeb -Includes WebTemplate, Configuration
$web.WebTemplate + "#" + $web.Configuration

备注

PnP PowerShell是一种开放源代码解决方案,具有活跃社区,为其提供支持。PnP PowerShell is an open-source solution with active community providing support for it. 没有用于 Microsoft 开放源代码工具支持的 SLA。There is no SLA for the open-source tool support from Microsoft.

使用 Microsoft 365 CLI 预配“新式”团队网站Provision a "modern" team site using the CLI for Microsoft 365

此外,Microsoft 365 CLI 可用于创建“新式”网站。Alternatively, the CLI for Microsoft 365 can be used to create "modern" sites. Microsoft 365 CLI 是跨平台命令行接口,可用于任何平台,包括 Windows、MacOS 和 Linux。The CLI for Microsoft 365 is a cross-platform command line interface that can be used on any platform, including Windows, MacOS and Linux.

备注

CLI for Microsoft 365是一种开放源代码解决方案,其中包含为其提供支持的活动社区。The CLI for Microsoft 365 is an open-source solution with active community providing support for it. 没有用于 Microsoft 开放源代码工具支持的 SLA。There is no SLA for the open-source tool support from Microsoft.

下面的 Bash 脚本展示了如何创建“新式”团队网站,并返回实际 SharePoint 网站 URL 以供进一步控制。The following bash script will create a "modern" team site and then return the actual SharePoint site URL for further manipulation. 一旦拥有访问创建的网站的 URL 的权限,就可以使用在创建的网站上自动执行其他操作。Once you have access to the URL of the created site, you can use it to automate other operations on the created site.

#!/usr/bin/env bash
# Connect to Microsoft 365 tenant
# This command will prompt a sign-in confirmation message to authenticate
m365 login

# Create the new "modern" team site
siteUrl=$(m365 spo site add --type TeamSite --title 'displayName' --alias 'mymodernteamsite' --description 'description' --isPublic --classification 'classification')

# Display the modern site url
echo $siteUrl

# Since the CLI for Microsoft 365 is connected to Microsoft 365 tenant we can do any operations. 
# As example, we can list all the properties from the site property bag:
m365 spo propertybag list -u $siteUrl

以编程方式预配 Microsoft 365 组Provision a Microsoft 365 group programmatically

也可以使用 Microsoft Graph 创建 Microsoft 365 组,以编程方式创建“新式”团队网站。"Modern" team sites can be created programmatically by creating a Microsoft 365 group using the Microsoft Graph. 实际上,创建 Microsoft 365 组后,此组会自动预配有“新式”团队网站。In fact, when you create a Microsoft 365 group, a "modern" team site is automatically provisioned for the group. “新式”团队网站 URI 以 Microsoft 365 组的 mailNickname 参数为依据,采用以下默认结构。The "modern" team site URI is based on the mailNickname parameter of the Microsoft 365 group and has the following default structure.

https://[tenant].sharepoint.com/sites/[mailNickname]

备注

若要详细了解如何使用 Microsoft Graph 创建组,请参阅官方文档A detailed description of group creation using Microsoft Graph is available from the official documentation.

使用 PnP CSOM 核心组件预配 Microsoft 365 组Provision a Microsoft 365 group using the PnP CSOM core component

NuGet 包形式的 PnP CSOM 核心组件简化了“新式”组处理方法。The PnP CSOM Core component, available as a NuGet package, has simplified methods for the "modern" group handling.

/// <summary>
/// Let's use the UnifiedGroupsUtility class from PnP CSOM Core to simplify managed code operations for Microsoft 365 groups
/// </summary>
/// <param name="accessToken">Azure AD Access token with Group.ReadWrite.All permission</param>
public static void ManipulateModernTeamSite(string accessToken)
{
    // Create new modern team site at the url https://[tenant].sharepoint.com/sites/mymodernteamsite
    Stream groupLogoStream = new FileStream("C:\\groupassets\\logo-original.png", 
                                            FileMode.Open, FileAccess.Read);
    var group = UnifiedGroupsUtility.CreateUnifiedGroup("displayName", "description", 
                            "mymodernteamsite", accessToken, groupLogo: groupLogoStream);
            
    // We received a group entity containing information about the group
    string url = group.SiteUrl;
    string groupId = group.GroupId;

    // Get group based on groupID
    var group2 = UnifiedGroupsUtility.GetUnifiedGroup(groupId, accessToken);
    // Get SharePoint site URL from group id
    var siteUrl = UnifiedGroupsUtility.GetUnifiedGroupSiteUrl(groupId, accessToken);

    // Get all groups in the tenant
    List<UnifiedGroupEntity> groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken);

    // Update description and group logo programatically
    groupLogoStream = new FileStream("C:\\groupassets\\logo-new.png", FileMode.Open, FileAccess.Read);
    UnifiedGroupsUtility.UpdateUnifiedGroup(groupId, accessToken, description: "Updated description", 
                                            groupLogo: groupLogoStream);

    // Delete group programatically
    UnifiedGroupsUtility.DeleteUnifiedGroup(groupId, accessToken);
}

使用 PnP PowerShell 预配 Microsoft 365 组Provision a Microsoft 365 group using PnP PowerShell

也可以使用 PnP PowerShell 创建 Microsoft 365 组。使用这种方法,可以轻松地使用 Azure Active Directory 进行 Microsoft Graph 身份验证。You can also create a Microsoft 365 group using PnP PowerShell, which will let you easily authenticate with the Microsoft Graph using Azure Active Directory. 下面的脚本展示了如何创建 Microsoft 365 组和“新式”团队网站,并返回实际 SharePoint 网站 URL 以供进一步控制。The following script creates a Microsoft 365 group, together with a "modern" team site, and then returns the actual SharePoint site URL for further manipulation. 有权访问已创建网站的 URL 后,便可使用 CSOM(包含 SharePoint PnP 核心组件)或 SharePoint PnP-PowerShell 对已创建网站自动执行其他操作。After you have access to the URL of the created site, you can use CSOM (with the SharePoint PnP Core component) or SharePoint PnP-PowerShell to automate other operations on the created site.

# Connect to your SharePoint admin center, credentials will be asked
Connect-PnPOnline -Url https://contoso-admin.sharepoint.com

# Create a new modern team site
New-PnPSite -Type Team -Title "Awesome Group" -Description "Awesome Group" -Alias "awesome-group"

使用 SharePoint Online Management Shell 或 PnP PowerShell 预配新式团队网站Provision a modern team site using SharePoint Online Management Shell or PnP PowerShell

也可以使用 PowerShell 创建未连接到组的新式网站。It is also possible to create a modern site which is not connected to a Group using PowerShell. 使用 PnP PowerShell cmdlet 或 SharePoint Online Management Shell。Either by using the PnP PowerShell cmdlets or the SharePoint Online Management Shell.

$title = "Awesome ModernTeamsite"
$url = "https://contoso.sharepoint.com/sites/awesomemodernteamsite"
$owner = "denisd@contoso.com"

// SharePoint Online Management Shell
New-SPOSite -Title $_title -Url $_url -Owner $owner -StorageQuota 512 -Template "STS#3"

// PnP
New-PnPTenantSite -Url $_url -Description $_title -Title $_title -Template STS#3 -Owner $owner

使用 Microsoft 365 CLI 预配 Microsoft 365 组Provision a Microsoft 365 group using the CLI for Microsoft 365

此外,Microsoft 365 CLI 可用于创建 Microsoft 365 组。Alternatively, the CLI for Microsoft 365 can be used to create a Microsoft 365 group.

#!/usr/bin/env bash
# Connect to Microsoft 365 tenant
# This command will prompt a sign-in confirmation message to authenticate
m365 login

# Create a Microsoft 365 group
# The newly created SharePoint site for that group will have the URL
# https://[tenant].sharepoint.com/sites/awesome-group
m365 aad o365group add --displayName 'Awesome Group' --description 'Awesome Group' --mailNickname awesome-group

预配“新式”通信网站Provisioning "modern" communication sites

此部分将介绍如何预配“新式”通信网站,以及具体有哪些方法可供选择。In this section, you learn how to provision a "modern" communication site, and what are the available options to do that.

通过用户界面预配“新式”通信网站Provision a "modern" communication site from the user interface

如果管理员在租户中启用了“新式”团队网站,若要使用用户界面预配“新式”通信网站,可以直接通过 SharePoint Online 主页启动。To provision a "modern" communication site using the user interface—if your administrator enabled "modern" team sites in your tenant—you can start directly from the SharePoint Online home page. 选择“创建网站”按钮,选择创建“通信网站”,选择网站设计,并提供名称和说明,网站将在数秒钟内创建完成。********Choose the Create Site button, select to create a Communication Site, choose a design for your site, provide a name and a description, and the site is created in a matter of seconds.

截至本文撰写之时,可供选择的通信网站设计如下:At the time of this writing the available designs for a communication site are:

  • 主题:如果需要共享大量信息(如资讯、活动和其他内容),请使用此设计。Topic: use this design if you have a lot of information to share such as news, events, and other content.
  • 展示:此设计可用于通过照片或图像来展示产品、团队或活动。Showcase: use this design to showcase a product, team, or event using photos or images.
  • 空白:从空白网站入手,轻松、快速地设计网站。Blank: start with a blank site and make your design come to life quickly and easily.

以编程方式预配“新式”通信网站Provision a "modern" communication site programmatically

如果愿意,可以使用 CSOM 和 PnP 或 PowerShell 以编程方式创建“新式”通信网站。If you prefer, you can create a "modern" communication site programmatically by using either CSOM and PnP, or PowerShell.

使用 PnP CSOM 核心组件预配“新式”通信网站Provision a "modern" communication site using the PnP CSOM Core component

NuGet 包形式的 PnP CSOM 核心组件简化了“新式”网站处理方法。The PnP CSOM Core component, available as a NuGet package, has simplified methods for the "modern" sites handling.

// 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" communication site at the url https://[tenant].sharepoint.com/sites/mymoderncommunicationsite
    var communicationContext = await context.CreateSiteAsync(new CommunicationSiteCollectionCreationInformation {
        Title = "title", // Mandatory
        Description = "description", // Mandatory
        Lcid = 1033, // Mandatory
        AllowFileSharingForGuestUsers = false, // Optional
        Classification = "classification", // Optional
        SiteDesign = CommunicationSiteDesign.Topic, // Mandatory
        Url = "https://[tenant].sharepoint.com/sites/mymoderncommunicationsite", // Mandatory
    });
    communicationContext.Load(communicationContext.Web, w => w.Url);
    communicationContext.ExecuteQueryRetry();
    Console.WriteLine(communicationContext.Web.Url);
}

可以看到,此扩展方法会新建“新式”通信网站,并返回直接连接到新建网站的新 ClientContext 对象。As you can see, the extension method creates a new "modern" communication site and returns a new ClientContext object directly connected to the newly created site.

使用 PnP PowerShell 预配“新式”通信网站Provision a "modern" communication site by using PnP PowerShell

下面的脚本展示了如何创建“新式”通信网站,并返回实际 SharePoint 网站 URL 以供进一步控制,类似上面的“新式”团队网站示例。The following script creates a "modern" communication site and then returns the actual SharePoint site URL for further manipulation, similar to the previous example with "modern" team sites.

# Connect to SharePoint Online
# This command will prompt the sign-in UI to authenticate
Connect-PnPOnline "https://[tenant].sharepoint.com/"

# Create the new "modern" communication site
$communicationSiteUrl = New-PnPSite -Type CommunicationSite -Title "displayName" -Url "https://[tenant].sharepoint.com/sites/mymoderncommunicationsite" -Description "description" -Classification "classification" -SiteDesign Topic

# Connect to the modern site using PnP PowerShell SP cmdlets
# Since we are connecting now to SP side, credentials will be asked
Connect-PnPOnline $communicationSiteUrl

# Now we have access on the SharePoint site for any operations
$context = Get-PnPContext
$web = Get-PnPWeb
$context.Load($web, $web.Title)
Execute-PnPQuery
$web.Title

使用 Microsoft 365 CLI 预配“新式”通信网站Provision a "modern" communication site using the CLI for Microsoft 365

此外,CLI for Microsoft 365 可用于创建“新式”通信网站。Alternatively, the CLI for Microsoft 365 can be used to create "modern" Communication site. 下面的 Bash 脚本将创建网站,然后返回实际 SharePoint 网站 URL 以供进一步控制。The following bash script will create the site and then return the actual SharePoint site URL for further manipulation. 一旦拥有访问 URL 的权限,就可以使用在创建的网站上自动执行其他操作。Once you have access to the URL you can use it to automate other operations on the created site.

#!/usr/bin/env bash
# Connect to Microsoft 365 tenant
# This command will prompt a sign-in confirmation message to authenticate
m365 login

# Create the new "modern" communication site
siteUrl=$(m365 spo site add --type CommunicationSite --url https://[tenant].sharepoint.com/sites/mymoderncommunicationsite --title displayName --description description --classification classification)

# Display the modern site url
echo $siteUrl

# Since the CLI for Microsoft 365 is connected to your Microsoft 365 tenant we can do any operations. 
# As example, we can list all the properties from the site property bag:
m365 spo propertybag list -u $siteUrl

其他注意事项Additional considerations

子网站使用“经典”模板Subsites use "classic" templates

如果在“新式”网站集的根网站下预配子网站,子网站使用的是“经典”模板。If you provision a subsite under the root site of a "modern" site collection, subsites will use "classic" templates. 暂无可用的“新式”子网站模板。There are currently no "modern" subsite templates available. 可以在网站中创建“新式”页面,再将欢迎页更新为新创建的页面,从而将“经典”子网站转换为“新式”团队网站。You can transform a "classic" subsite to a "modern" team site by creating a "modern" page on the site and updating the welcome page to the newly created page.

如果不想让用户在“新式”网站集下创建“经典”子网站,作为管理员可以转到 SharePoint 管理中心,选择“设置”页,再将“子网站创建”选项配置为隐藏“子网站”创建菜单。********If you don't want to allow users to create a "classic" subsite under a "modern" site collection, as an admin you can go to the SharePoint Admin Center, select the Settings page and configure the option for Subsite Creation to hide the subsite creation menu. 下图展示了“子网站创建”选项。****You can see the Subsite Creation option in the following image.

SharePoint Online 管理 UI 中的“子网站创建”选项

经典 SharePoint 管理 UI/租户 API 中不会列出网站Sites are not listed in the classic SharePoint Admin UI / Tenant API

SharePoint 管理 UI 中不会显示“新式”团队网站。"Modern" team sites are not visible in the SharePoint admin UI. 可以通过 Office 365 管理员门户下的 Microsoft 365 组管理用户界面访问“新式”团队网站的列表。You can access the list of "modern" team sites from the Microsoft 365 groups admin user interface under Office 365 admin portal. SharePoint Online 管理用户界面只会列出“经典”SharePoint 网站。SharePoint Online admin user interface only list "classic" SharePoint sites. 同一限制并不适应于租户 API:可以使用此 API 与“经典”团队网站一起枚举“新式”团队网站。This same limitation does not apply to the tenant API: you can use this API to enumerate "modern" team sites together with "classic" team sites. 若要获取只包含“新式”团队网站的列表,还可以使用 Microsoft Graph API 中的组终结点。To obtain a list of only "modern" team sites, you can also use the Groups endpoint from Microsoft Graph API.

我们还即将推出新 SharePoint 管理 UI,支持同时管理新的“新式”网站集和“经典”网站集。There is also an upcoming new SharePoint Admin UI, which supports managing the new "modern" site collections, together with the "classic" ones.

另请参阅See also