禁用除特定组以外的所有站点创建

时间:2017-11-20 22:25:13

标签: sharepoint-online

我想将网站创建锁定到特定的一组admin suresh。我们已经为此创建了一个组,但是为了实现这一点,我应该告诉SharePoint管理员做什么?

1 个答案:

答案 0 :(得分:1)

要锁定网站创建,您基本上需要使用Azure AD PowerShell运行一些PowerShell命令,如下所示。使用Global admin priviledges运行命令。

我假设您已创建一个Azure AD组,其中某些用户有权创建该网站。

$creds = Get-Credential

Connect-AzureAD -Credential $creds

$group = Get-AzureADGroup -All $True | Where-Object {$_.DisplayName -eq "ENTER GROUP DISPLAY NAME HERE"} 

$policySetting = Get-AzureADDirectorySetting | where-object {$_.displayname -eq "Group.Unified"}

if($policySetting -eq $null) {

    $template = Get-AzureADDirectorySettingTemplate | Where-Object {$_.DisplayName -eq "Group.Unified"}

    $settings = $template.CreateDirectorySetting()

    $settings["EnableGroupCreation"] = $false

    $settings["GroupCreationAllowedGroupId"] = $group.ObjectId

    $policySetting = New-AzureADDirectorySetting -DirectorySetting $settings
}
else{

    $policySetting["EnableGroupCreation"] = $false

    $policySetting["GroupCreationAllowedGroupId"] = $group.ObjectId    

    Set-AzureADDirectorySetting -Id $policySetting.Id -DirectorySetting $policySetting
}

链接:

Installing the Azure AD module

代码修改自 - Managing Office 365 group creation using Azure AD PowerShell v2