TylerDurham icon

Govern Office 365 Group Creation

TylerDurham | PRO | 02/02/18 06:01:00 PM UTC | 0 ⭐ | 222 👁️ | Never ⏰ | []
PowerShell |

850 B

|

None

|

0 👍

/

0 👎

# ========================================================================================
# Update an existing directory settings to disallow Office 365 Group Creation by users NOT in the 
# proper Azure AD group. The directory settings must exist first.
#
# More info at: http://drp.mk/i/yTWX9dvJ42
# ========================================================================================
 
# 1) Grab the directorysetting
$setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id # Grab the setting
 
# 2) Set properties for the setting
$setting["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString "<NAME-OF-YOUR_GROUP>").objectid
$setting["EnableGroupCreation"] = $False
 
# 3) Update the setting.
Set-AzureADDirectorySetting -Id $setting.Id -DirectorySetting $setting

Comments