Forum Discussion
Enforce naming conventions across Office 365 Groups
Now that we can enforce naming standards in Azure AD vs exchange, has anyone tried yet?
Does it update existing groups like exchange did?
thanks,jb
- DeletedMar 12, 2018
I ran into that too, and I think my problem was because I hadn't actually created the Group.Unified object/setting in AzureAD yet. Therefore, the error report was technically correct.
Check this to see if you have anything configured:
Get-AzureADDirectorySetting | ForEach Values
If not, create the settings AAD object:
Creating the Group.Unified Settings object (1-time task)
$template = Get-AzureADDirectorySettingTemplate | where-object {$_.displayname -eq “Group.Unified”}
$setting = $template.CreateDirectorySetting()
New-AzureADDirectorySetting -DirectorySetting $setting
After that, the 'is null' error should go away as the setting actually exists.
Re-run Get-AzureADDirectorySetting | ForEach Values and you should at least see the blank settings.
I found this site extremely helpful getting my settings configured & managing them:
https://drewmadelung.com/managing-office-365-group-using-azure-ad-powershell-v2/
HTH
16 Replies
- Michael BlairCopper ContributorI've been working on this and it appears the PowerShell for this has been changed and I can't get a Microsoft support engineer that knows to what. The Group.Unified object/setting in AzureAD appears to have been deprecated. However, this can be accomplished via the Exchange Admin Center. Navigate to Recipients->Groups section. Select the elipses for options. Select, "Group Naming Policy". That will allow you to specify a prefix, suffix or blocked words for groups created by users.
- Deleted
I had a lot of success configuring and using the Groups AAD settings last week, with one exception: Naming Policy. Below is the output from the Groups Settings I have in place.
I cannot get the "O365Grp-[GroupName]" prefix to be generated on any new groups. Based on the research I did, the brackets serve to insert the actual group name, and it's just not happening. When I created the 'PrefixSuffixNamingRequirement' setting, I didn't get an error. I've also changed it around a bit, to include/exclude the [GroupName] component but nothing made any difference.
Any suggestions are appreciated.
Thx
Any suggestions?
- cfiessinger
Microsoft
Jason it only applies to net new created groups and it does not update existing ones, please see this article for more details, please note it's a "Public Preview": https://support.office.com/en-us/article/office-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d469dfbbb552?ui=en-US&rs=en-US&ad=US
- Jason BenwayIron Contributor
I'm trying to create a new policy with the command
Set-AzureADDirectorySetting -Id group-policy -DirectorySetting “[Company]-"
I'm getting an error
Set-AzureADDirectorySetting : Cannot bind parameter 'DirectorySetting'. Cannot convert the "[Company]-" value of type "System.String" to type "Microsoft.Open.MSGraph.Model.DirectorySetting".
Any ideas?
- cfiessinger
Microsoft
Correct syntax for an existing policy:
$Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id
$Setting["CustomBlockedWordsList"]=“contoso,payroll,ceo,cfo,hr,sales,marketing,info,admin,null,vulgar,ass,shit,zut,merde"
$Setting["PrefixSuffixNamingRequirement"]=“G_[GroupName]_[Department]"Set-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id -DirectorySetting $Setting