Manage who is allowed to create groups in Office 365

Currently, the use of Microsoft Teams for teaching around the world is continuously increasing. However, in the process of using teachers will also encounter a lot of annoying pedagogical situations, such as students setting up secret chat groups on it to do their own work ... But teachers should not be too worry Microsoft provides us with tools so that teachers may want to make this easier to control.

In this tutorial, we will set up allowing who is allowed to create groups on Microsoft Teams

To do this, teachers first need to have an Office 365 system administrator account of their school or unit

Step 1: Create a security group for users who need to create an Office 365 Group

 Important!

When using a  security group  to restrict who can create groups, you should also consider that this will not allow members outside the security group to create groups on the Office 365 sharepoint.

Perform

  • In the Microsoft 365 Admin Center , Select Groups > Groups.

Manage who is allowed to create groups in Office 365

  • Click Add a GroupManage who is allowed to create groups in Office 365
  • Select the Security group type -> Next

Manage who is allowed to create groups in Office 365

  • Name the group and click Next

Manage who is allowed to create groups in Office 365

  • Click Create a group to complete the security group setup, add people or other security groups that teachers want to be able to create groups in their school or unit.

Step 2: Run the above PowerShell command

Teachers need to make sure that Powershell is installed on the computer

Manage who is allowed to create groups in Office 365

Copy the script below into Windows PowerShell ISE .

Replace  SecurityGroupName >  with the name of the security group you created. For example:

$GroupName = "Group Creators"

Save the file as GroupCreators.ps1

In the PowerShell window , use the CD command to return to the folder where the teacher saved the GroupCreators.ps1 file (enter “CD”). Assuming that file is saved in the adminschool folder, drive D, the teacher will type the command as shown

Manage who is allowed to create groups in Office 365

Run the script by typing:

.\GroupCreators.ps1

Manage who is allowed to create groups in Office 365

Then you log in with your administrator account at the Powershell command prompt

$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 show the updated settings:

Manage who is allowed to create groups in Office 365

If you later want to change which security group is used, you can run the above script again with the name of the new security group.

If you want to turn off the group creation limit and allow all users to create groups (including students, set $GroupName to “” and $AllowgroupCreation to “True” and run the above script again.

Step 3: Double check if it's already working?

  1. Sign in to Office 365 with a user account that isn't allowed in groups to create groups. 
  2. Select Teams
  3. In Teams, try to create a new group
  4. Teachers will receive a notification to disable the group creation function.

If there are any problems in the process of running the command on Powershell, please create a Ticket and send it to Microsoft's technical support for detailed support (because this is a newly updated feature, there is no many people have experience in this) or select Support in the Microsoft 365 Admin Center

Good luck teachers!

Leave a Comment

Fix CODE’s WOPI Host Check by Matching the Host Origin

Fix CODE’s WOPI Host Check by Matching the Host Origin

Allow the exact Nextcloud or other WOPI origin in CODE, then verify the active host allow-list and distinguish it from Nextcloud’s source-IP restriction.

Resolve Collabora’s “Well, This Is Embarrassing” Error

Resolve Collabora’s “Well, This Is Embarrassing” Error

Trace Collabora’s browser, WOPI, and WebSocket connections to find why a document will not open, then apply the fix that matches your Nextcloud setup.

Run Collabora Online Across Kubernetes Nodes

Run Collabora Online Across Kubernetes Nodes

Deploy Collabora CODE replicas with Helm, keep each document on one pod through WOPI affinity, and verify ingress, node placement, and Nextcloud editing.

Restore Collaboras WebSocket Connection Through the Proxy

Restore Collaboras WebSocket Connection Through the Proxy

Trace a failed socket handshake from browser to coolwsd, then match the reverse-proxy route to your Collabora version, including the CODE 26.04 Apache change.

Fix WOPI Proof Errors by Checking Keys, Discovery, and URLs

Fix WOPI Proof Errors by Checking Keys, Discovery, and URLs

Trace Collabora WOPI proof failures to mismatched keys, stale discovery data, clock drift, or proxy URL changes—without weakening validation.

Fix a Misrendered Collabora Online Font Size Dropdown

Fix a Misrendered Collabora Online Font Size Dropdown

Reset browser zoom, test a clean session, and identify when a malformed size menu needs a Collabora server update.

Connect Nextcloud to a Self-Hosted Collabora CODE Container

Connect Nextcloud to a Self-Hosted Collabora CODE Container

Deploy Collabora CODE with Docker, connect it securely to Nextcloud Office, and verify document editing with practical WOPI and proxy checks.

Trace Collabora Connection Failures with coolwsd Logs

Trace Collabora Connection Failures with coolwsd Logs

Temporarily raise coolwsd to debug, capture one failed open, and use the log sequence to separate WebSocket, WOPI, proxy, and container issues.

Set a Secure Password for the Collabora Admin Console

Set a Secure Password for the Collabora Admin Console

Configure the Collabora Online admin login for Docker or Linux, restart the right service, and verify the new password without exposing it.

Diagnose High CPU from Collabora’s coolwsd or loolwsd

Diagnose High CPU from Collabora’s coolwsd or loolwsd

Find out whether CPU load comes from active documents, idle worker processes, or server capacity before changing Collabora settings or restarting the service.