天天看點

SharePoint 開發:如何禁用預設SharePoint Creation

Blog連結:https://blog.51cto.com/13969817

預設的情況下,所有有權限的使用者都可以在+New菜單中建立content,為了便于管理,管理者可以使用SharePoint Online Management Shell全局禁用或者每個站點集合。

說明:在執行PowerShell腳本之前,確定module至少更新到16.0.20912.12000版本,因為要使用的cmdlet隻在這個版本中引入。

具體禁用的操作步驟如下:

  1. 管理者身份執行以下指令來更新SharePoint Online Management Shell到最新版本,Update-Module -Name Microsoft.Online.SharePoint.PowerShell
  2. 如果您不希望在預設情況下跨租戶的+New菜單中顯示Space菜單項,則需要通過執行以下PowerShell腳本啟用租戶級控制:
    Connect-SPOService -Url https://contoso-admin.sharepoint.com
    Set-SPODisableSpacesActivation -scope tenant -Disable $true           

說明:通過執行下面的腳本在+New菜單中啟用選項。

Connect-SPOService -Url https://contoso-admin.sharepoint.com
Set-SPODisableSpacesActivation -scope tenant -Disable $false           
Connect-SPOService -Url https://contoso-admin.sharepoint.com
$siteCollectionURL = https://contoso.sharepoint.com/sites/Support
Set-SPODisableSpacesActivation -scope site -Disable $true -Identity $siteCollectionURL           
Connect-SPOService -Url https://contoso-admin.sharepoint.com
$siteCollectionURL = https://contoso.sharepoint.com/sites/Support
Set-SPODisableSpacesActivation -scope site -Disable $false -Identity $siteCollectionURL