[英]SharePoint CSOM Removesite does not work with modern Team Sites
嘗試刪除使用現代團隊網站創建的網站集時,對CSOM RemoveSite的調用將引發異常:
“此站點屬於office365組。要刪除該站點,必須刪除該組。”
SpoOperation removeSiteOperation = tenant.RemoveSite(siteCollectionUrl);
context.Load(tenant);
有什么方法可以強制刪除,找到要刪除的組或使用新的api?
我們可以刪除使用現代團隊網站創建的網站集,我們可以使用下面的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
參考: 從回收站中完全刪除經典或現代的Office365網站集
並檢查下面類似的線程。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.