Skip to content

Instantly share code, notes, and snippets.

@mirontoli
Last active May 13, 2019 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirontoli/b4195797b8a7a0ffe2be0e797306b947 to your computer and use it in GitHub Desktop.
Save mirontoli/b4195797b8a7a0ffe2be0e797306b947 to your computer and use it in GitHub Desktop.
#https://docs.microsoft.com/sv-se/office365/admin/create-groups/manage-creation-of-groups?view=o365-worldwide
Connect-AzureAD
$newSetting = Get-AzureADDirectorySetting | ? { $_.DisplayName -eq "Group.Unified" }
$settingsObjectID = $newSetting.id
$settingsCopy = Get-AzureADDirectorySetting -Id $settingsObjectID
$settingsCopy["EnableGroupCreation"] = $false
$creatorsGroup = Get-AzureADGroup -SearchString "Creators"
$settingsCopy["GroupCreationAllowedGroupId"] = $creatorsGroup.ObjectId
Set-AzureADDirectorySetting -Id $settingsObjectID -DirectorySetting $settingsCopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment