Hi everyone,
This video will show how to prevent or limit users from creating groups in Office 365. By default, all users can create Microsoft 365 groups.
When you limit who can create a group, it affects all services that rely on groups for access, including:
- Outlook
- SharePoint
- Yammer
- MS Teams
- MS Stream
- Planner
- Power BI (Classic)
- Project for the Web/Roadmap
PowerShell commands:
$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
You could breathe life into any topic! Good job!
Thanks for the post
Thank you 🙂
I was interested in the thread, but I can’t respond there.
Thank you 🙂
Thanks for your help and for writing this post. It’s been great.
Thank you for your articles. They are very helpful to me. May I ask you a question?
Hi,
How can I help you?