Step 1: Create a group for users who need to create Microsoft 365 groups
Only one group in your organization can be used to control who is able to create Groups. But, you can nest other groups as members of this group.
Admins in the roles listed above do not need to be members of this group: they retain their ability to create groups.
- In the admin center, go to the Groups page.
- Click on Add a Group.
- Choose the group type you want. Remember the name of the group! You’ll need it later.
- Finish setting up the group, adding people or other groups who you want to be able to create groups in your org.
For detailed instructions, see Create, edit, or delete a security group in the Microsoft 365 admin center.
Step 2: Run PowerShell commands
You must use the preview version of Azure Active Directory PowerShell for Graph (AzureAD) (module name AzureADPreview) to change the group-level guest access setting:
- If you haven’t installed any version of the Azure AD PowerShell module before, see Installing the Azure AD Module and follow the instructions to install the public preview release.
- If you have the 2.0 general availability version of the Azure AD PowerShell module (AzureAD) installed, you must uninstall it by running
Uninstall-Module AzureADin your PowerShell session, and then install the preview version by runningInstall-Module AzureADPreview. - If you have already installed the preview version, run
Install-Module AzureADPreviewto make sure it’s the latest version of this module.
Copy the script below into a text editor, such as Notepad, or the Windows PowerShell ISE.
Replace <GroupName> with the name of the group that you created. For example:
$GroupName = "Group Creators"
Save the file as GroupCreators.ps1.
In the PowerShell window, navigate to the location where you saved the file (type “CD <FileLocation>”).
Run the script by typing:
.\GroupCreators.ps1
and sign in with your administrator account when prompted.
SCRIPT
$GroupName = "<GroupName>"
$AllowGroupCreation = $False
Connect-AzureAD
$settingsObjectID = (Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).id
if(!$settingsObjectID)
{
$template = Get-AzureADDirectorySettingTemplate | Where-object {$_.displayname -eq "group.unified"}
$settingsCopy = $template.CreateDirectorySetting()
New-AzureADDirectorySetting -DirectorySetting $settingsCopy
$settingsObjectID = (Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).id
}
$settingsCopy = Get-AzureADDirectorySetting -Id $settingsObjectID
$settingsCopy["EnableGroupCreation"] = $AllowGroupCreation
if($GroupName)
{
$settingsCopy["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString $GroupName).objectid
} else {
$settingsCopy["GroupCreationAllowedGroupId"] = $GroupName
}
Set-AzureADDirectorySetting -Id $settingsObjectID -DirectorySetting $settingsCopy
(Get-AzureADDirectorySetting -Id $settingsObjectID).Values
The last line of the script will display the updated settings:

If in the future you want to change which group is used, you can rerun the script with the name of the new group.
If you want to turn off the group creation restriction and again allow all users to create groups, set $GroupName to “” and $AllowGroupCreation to “True” and rerun the script.
Step 3: Verify that it works
Changes can take thirty minutes or more to take effect. You can verify the new settings by doing the following:
- Sign in to Microsoft 365 with a user account of someone who should NOT have the ability to create groups. That is, they are not a member of the group you created or an administrator.
- Select the Planner tile.
- In Planner, select New Plan in the left navigation to create a plan.
- You should get a message that plan and group creation is disabled.
Leave a Reply