This can be achieved only with a PowerShell script because, right now, standard Office 365 UI do not give us this option.
Important: in order to be able to execute the script you need the Preview of AzureAD module for PowerShell. This is called "AzureADPreview".
If you already have installed production AzureAD module, you need to uninstall it and then install new preview version of the same module.
Uninstall-Module AzureAD
Install-Module AzureADPreview
Once you have this module correctly installed, all you need is to execute this script.
Change the $groupName variable to fit your environment.
This AzureAD Security Group will be the only that later can create Teams.
Keep in mind that also Global Admin members can create Microsoft Teams.
#Connect to AAD
$AzureAdCred = Get-Credential
Connect-AzureAD -Credential $AzureAdCred
$groupName = "UsersCanCreateTeams"
Get-AzureADGroup -SearchString $groupName
$Template = Get-AzureADDirectorySettingTemplate | where {$_.DisplayName -eq 'Group.Unified'}
$Setting = $Template.CreateDirectorySetting()
New-AzureADDirectorySetting -DirectorySetting $Setting
$Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id
$Setting["EnableGroupCreation"] = $False
$Setting["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString $groupName).objectid
Set-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id -DirectorySetting $Setting
9 comments:
Thank you for sharing wonderful information with us to get some idea about it.
Office 365 Training
Office 365 Online Training
Works! Thanks
It works great!
But now I have tested the working of the scrip I would like to revert it again.
I cannot find the right way to accomplish that.
Any ideas
Thanks
Frans
how can i revert it ?
To revert it I would imagine you need to change the following;
$Setting["EnableGroupCreation"] = $False
to
$Setting["EnableGroupCreation"] = $True
This will also disable creation of Planner, Yammer and other apps driven by office 365 group
Does this work if you don't have Azure AD Premium?
Great article
Manual Testing training
Open stack training
SAP ABAP on Hana training
Guys please HELP!!
i WANT TO ALLOW THE CREATIONS BUT, I DON'T KNOW HOW :(
Please guys give me a hand. I beg you
Post a Comment