【问题标题】:SharePoint CSOM Removesite does not work with modern Team SitesSharePoint CSOM Removesite 不适用于新式团队网站
【发布时间】:2019-07-04 09:36:24
【问题描述】:

尝试删除使用现代团队站点创建的站点集合时,对 CSOM RemoveSite 的调用会引发异常:

“此站点属于 office365 组。要删除该站点,您必须删除该组。”

SpoOperation removeSiteOperation = tenant.RemoveSite(siteCollectionUrl);
context.Load(tenant);

有什么方法可以强制删除,找到要删除的组或者使用新的api?

【问题讨论】:

    标签: sharepoint csom


    【解决方案1】:

    我们可以删除使用现代团队网站创建的网站集,我们可以使用下面的 PnP PowerShell 来实现。

    $credential = Get-Credential
    Connect-PnPOnline https://[tenant].sharepoint.com -credential $credential
    Remove-PnPTenantSite https://[tenant].sharepoint.com/sites/ModernTeamSite 
    

    并使用下面的 PowerShell 删除组。

    $credential = Get-Credential
    Connect-PnPOnline https://[tenant].sharepoint.com -credential $credential
    Remove-PnPUnifiedGroup -Identity groupID // you can get group Ids from Get-PnPUnifiedGroup
    

    参考:Completely delete an Office365 site collection classic or modern from recycle bin

    并且还检查下面的类似线程。

    Unable to remove Office 365 Group Site Collection

    【讨论】:

      猜你喜欢
      • 2011-04-17
      • 1970-01-01
      • 2013-05-27
      • 1970-01-01
      • 1970-01-01
      • 2018-06-16
      • 2017-01-30
      • 2022-01-14
      • 2019-03-10
      相关资源
      最近更新 更多