SOLVED

Enforce naming conventions across Office 365 Groups

%3CLINGO-SUB%20id%3D%22lingo-sub-167963%22%20slang%3D%22en-US%22%3EEnforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-167963%22%20slang%3D%22en-US%22%3E%3CP%3ENow%20that%20we%20can%20enforce%20naming%20standards%20in%20Azure%20AD%20vs%20exchange%2C%20has%20anyone%20tried%20yet%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDoes%20it%20update%20existing%20groups%20like%20exchange%20did%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ethanks%2Cjb%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-167963%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGroups%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20Groups%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215203%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215203%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20sir%20for%20your%20response.%20It%20worked%20by%20this.%20And%20I%20am%20cursing%20myself%20why%20didn't%20i%20try%20tab%20before.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-AzureADDirectorySetting%20-ObjectId%20%24settings.Id%20-DirectorySetting%20%24settings%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-objectID%20instead%20of%20-id%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20a%20great%20day.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215154%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215154%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Sir%2C%3C%2FP%3E%3CP%3EI%20generated%20those%20error%20in%20my%20question%20to%20show%20you.%20And%20I%20am%20following%20the%20same%20article.%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------%3C%2FP%3E%3CP%3ENew-AzureADDirectorySetting%20-DirectorySetting%20%24Setting%20-%20Here%20is%20an%20error%20in%20the%20original%20post%20and%20it%20is%20expected%20as%20per%20the%20article.%3C%2FP%3E%3CP%3E----------------------------------------------------------------------%3C%2FP%3E%3CP%3E%24Setting%20%3D%20Get-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%3CBR%20%2F%3EGet-AzureADDirectorySetting%20%3A%20A%20parameter%20cannot%20be%20found%20that%20matches%20parameter%20name%20'Id'%3C%2FP%3E%3CP%3E-%20According%20to%20error%2C%20I%20did%20a%20little%20different%20but%20same%20task.%3C%2FP%3E%3CP%3E%24Setting%20%3D%20Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ%3C%2FP%3E%3CP%3ESo%20I%20have%20proceeded%20further.%3C%2FP%3E%3CP%3E----------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3Eon%26nbsp%3BLast%20step%2C%20I%20am%20struggling%3C%2FP%3E%3CP%3ESet-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ%20-DirectorySetting%20%24Setting%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20not%20recognizing%20%24settings%20parameter...tried%20different%20values.%26nbsp%3B%3C%2FP%3E%3CP%3E----------------------------------------------------%3C%2FP%3E%3CP%3EAnd%20in%20My%20original%20post%2C%20you%20can%20see%20I%20have%20posted%20in%20last%20%24setting%20parameter%20value%20as%20to%20eliminate%20the%20doubt%20of%20null%20value.%3C%2FP%3E%3CP%3E-----------------------------------------------------%3C%2FP%3E%3CP%3EMay%20I%20request%20you%20to%20provide%20your%20comment%20on%20this%3F%20It%20would%20be%20grateful.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214928%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214928%22%20slang%3D%22en-US%22%3E%3CP%3ELots%20of%20errors%20in%20your%20multiple%20cmdlets%2C%20please%20follow%20the%20step%20by%20step%20from%20this%20article%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FManage-who-can-create-Office-365-Groups-4c46c8cb-17d0-44b5-9776-005fced8e618%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FManage-who-can-create-Office-365-Groups-4c46c8cb-17d0-44b5-9776-005fced8e618%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214678%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214678%22%20slang%3D%22en-US%22%3E%3CP%3EKindly%20suggest%20what%20is%20wrong%20happening%20here%2C%20Tried%20everything%20in%20Directory%20Parameter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Get-AzureADGroup%20-SearchString%20%22AllowedtocreateO365Groups%22%3C%2FP%3E%3CP%3EObjectId%20DisplayName%20Description%3CBR%20%2F%3E--------%20-----------%20-----------%3CBR%20%2F%3Ead5ceeae-033f-46e8-99dd-fbc570bbc0e8%20AllowedtocreateO365Groups%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Get-AzureADGroup%20-SearchString%20%22AllowedtocreateO365Groups%22%3C%2FP%3E%3CP%3EObjectId%20DisplayName%20Description%3CBR%20%2F%3E--------%20-----------%20-----------%3CBR%20%2F%3Ead5ceeae-033f-46e8-99dd-fbc570bbc0e8%20AllowedtocreateO365Groups%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Template%20%3D%20Get-AzureADDirectorySettingTemplate%20%7C%20where%20%7B%24_.DisplayName%20-eq%20'Group.Unified'%7D%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Setting%20%3D%20%24Template.CreateDirectorySetting()%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20New-AzureADDirectorySetting%20-DirectorySetting%20%24Setting%3CBR%20%2F%3ENew-AzureADDirectorySetting%20%3A%20Error%20occurred%20while%20executing%20NewDirectorySetting%3CBR%20%2F%3EStatusCode%3A%20BadRequest%3CBR%20%2F%3EErrorCode%3A%20Request_BadRequest%3CBR%20%2F%3EMessage%3A%20A%20conflicting%20object%20with%20one%20or%20more%20of%20the%20specified%20property%20values%20is%20present%20in%20the%20directory.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20New-AzureADDirectorySetting%20-DirectorySetting%20%24Setting%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BNew-AzureADDirectorySetting%5D%2C%20ApiException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Open.MSGraphBeta.Client.ApiException%2CMicrosoft.Open.MSGraphBeta.PowerShell.NewDirectorySetting%3C%2FP%3E%3CP%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Get-AzureADDirectorySetting%3C%2FP%3E%3CP%3EId%20DisplayName%20TemplateId%20Values%3CBR%20%2F%3E--%20-----------%20----------%20------%3CBR%20%2F%3E0dd206ca-7d7d-4649-bb2e-ca8246f11a3e%20Group.Unified%2062375ab9-6b52-47ed-826b-58e47e0e304b%20%7Bclass%20SettingValue%20%7B...%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Setting%20%3D%20Get-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%3CBR%20%2F%3EGet-AzureADDirectorySetting%20%3A%20A%20parameter%20cannot%20be%20found%20that%20matches%20parameter%20name%20'Id'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A40%3CBR%20%2F%3E%2B%20%24Setting%20%3D%20Get-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetti%20...%3CBR%20%2F%3E%2B%20~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidArgument%3A%20(%3A)%20%5BGet-AzureADDirectorySetting%5D%2C%20ParameterBindingException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20NamedParameterNotFound%2CMicrosoft.Open.MSGraphBeta.PowerShell.GetDirectorySetting%3C%2FP%3E%3CP%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Setting%20%3D%20Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Setting%5B%22EnableGroupCreation%22%5D%20%3D%20%24False%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24Setting%5B%22GroupCreationAllowedGroupId%22%5D%20%3D%20(Get-AzureADGroup%20-SearchString%20%22AllowedtocreateO365Groups%22).objectid%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Set-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ%20-DirectorySetting%20%24Setting%3C%2FP%3E%3CP%3Ecmdlet%20Set-AzureADDirectorySetting%20at%20command%20pipeline%20position%201%3CBR%20%2F%3ESupply%20values%20for%20the%20following%20parameters%3A%3CBR%20%2F%3EDirectorySetting%3A%20AllowedtocreateO365Groups%3CBR%20%2F%3ESet-AzureADDirectorySetting%20%3A%20Cannot%20bind%20parameter%20'DirectorySetting'.%20Cannot%20convert%20the%20%22AllowedtocreateO365Groups%22%20value%20of%20type%20%22System.String%22%20to%20type%20%22Microsoft.Open.MSGraph.Model.DirectorySetting%22.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Set-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Gr%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidArgument%3A%20(%3A)%20%5BSet-AzureADDirectorySetting%5D%2C%20ParameterBindingException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20CannotConvertArgumentNoMessage%2CMicrosoft.Open.MSGraphBeta.PowerShell.SetDirectorySetting%3C%2FP%3E%3CP%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24setting%3C%2FP%3E%3CP%3EId%20DisplayName%20TemplateId%20Values%3CBR%20%2F%3E--%20-----------%20----------%20------%3CBR%20%2F%3E0dd206ca-7d7d-4649-bb2e-ca8246f11a3e%20Group.Unified%2062375ab9-6b52-47ed-826b-58e47e0e304b%20%7Bclass%20SettingValue%20%7B...%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20(Get-AzureADDirectorySetting).values%3C%2FP%3E%3CP%3EName%20Value%3CBR%20%2F%3E----%20-----%3CBR%20%2F%3ECustomBlockedWordsList%3CBR%20%2F%3EEnableMSStandardBlockedWords%20False%3CBR%20%2F%3EClassificationDescriptions%3CBR%20%2F%3EDefaultClassification%3CBR%20%2F%3EPrefixSuffixNamingRequirement%3CBR%20%2F%3EAllowGuestsToBeGroupOwner%20False%3CBR%20%2F%3EAllowGuestsToAccessGroups%20True%3CBR%20%2F%3EGuestUsageGuidelinesUrl%3CBR%20%2F%3EGroupCreationAllowedGroupId%3CBR%20%2F%3EAllowToAddGuests%20True%3CBR%20%2F%3EUsageGuidelinesUrl%3CBR%20%2F%3EClassificationList%3CBR%20%2F%3EEnableGroupCreation%20True%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-188103%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-188103%22%20slang%3D%22en-US%22%3EI've%20been%20working%20on%20this%20and%20it%20appears%20the%20PowerShell%20for%20this%20has%20been%20changed%20and%20I%20can't%20get%20a%20Microsoft%20support%20engineer%20that%20knows%20to%20what.%20The%20Group.Unified%20object%2Fsetting%20in%20AzureAD%20appears%20to%20have%20been%20deprecated.%20However%2C%20this%20can%20be%20accomplished%20via%20the%20Exchange%20Admin%20Center.%20Navigate%20to%20Recipients-%26gt%3BGroups%20section.%20Select%20the%20elipses%20for%20options.%20Select%2C%20%22Group%20Naming%20Policy%22.%20That%20will%20allow%20you%20to%20specify%20a%20prefix%2C%20suffix%20or%20blocked%20words%20for%20groups%20created%20by%20users.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-171076%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-171076%22%20slang%3D%22en-US%22%3E%3CP%3ECorrect%20syntax%20for%20an%20existing%20policy%3A%3C%2FP%3E%0A%3CP%3E%24Setting%20%3D%20Get-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%3CBR%20%2F%3E%24Setting%5B%22CustomBlockedWordsList%22%5D%3D%E2%80%9Ccontoso%2Cpayroll%2Cceo%2Ccfo%2Chr%2Csales%2Cmarketing%2Cinfo%2Cadmin%2Cnull%2Cvulgar%2Cass%2Cshit%2Czut%2Cmerde%22%3CBR%20%2F%3E%24Setting%5B%22PrefixSuffixNamingRequirement%22%5D%3D%E2%80%9CG_%5BGroupName%5D_%5BDepartment%5D%22%3C%2FP%3E%0A%3CP%3ESet-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%20-DirectorySetting%20%24Setting%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170781%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170781%22%20slang%3D%22en-US%22%3EThank%20you%2C%20this%20was%20the%20part%20I%20was%20missing!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170756%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170756%22%20slang%3D%22en-US%22%3E%3CP%3EI%20ran%20into%20that%20too%2C%20and%20I%20think%26nbsp%3Bmy%20problem%20was%20because%20I%20hadn't%20actually%20created%20the%20Group.Unified%20object%2Fsetting%20in%20AzureAD%20yet.%26nbsp%3B%20Therefore%2C%20the%20error%20report%20was%20technically%20correct.%3C%2FP%3E%0A%3CP%3ECheck%20this%20to%20see%20if%20you%20have%20anything%20configured%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-AzureADDirectorySetting%20%7C%20ForEach%20Values%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20not%2C%20create%20the%20settings%20AAD%20object%3A%3C%2FP%3E%0A%3CP%3ECreating%20the%20Group.Unified%20Settings%20object%20(1-time%20task)%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%24template%20%3D%20Get-AzureADDirectorySettingTemplate%20%7C%20where-object%20%7B%24_.displayname%20-eq%20%E2%80%9CGroup.Unified%E2%80%9D%7D%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%24setting%20%3D%20%24template.CreateDirectorySetting()%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3ENew-AzureADDirectorySetting%20-DirectorySetting%20%24setting%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20that%2C%20the%20'is%20null'%20error%20should%20go%20away%20as%20the%20setting%20actually%20exists.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERe-run%26nbsp%3B%3CEM%3EGet-AzureADDirectorySetting%20%7C%20ForEach%20Values%3C%2FEM%3E%20and%20you%20should%20at%20least%20see%20the%20blank%20settings.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20found%20this%20site%20extremely%20helpful%20getting%20my%20settings%20configured%20%26amp%3B%20managing%20them%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdrewmadelung.com%2Fmanaging-office-365-group-using-azure-ad-powershell-v2%2F%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdrewmadelung.com%2Fmanaging-office-365-group-using-azure-ad-powershell-v2%2F%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EHTH%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170696%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170696%22%20slang%3D%22en-US%22%3E%3CP%3EGet-AzureADDirectorySetting%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ereturns%20nothing%2C%20so%20when%20I%20try%20to%20run%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3E%24%3C%2FSPAN%3E%3CSPAN%3ESetting%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-AzureADDirectorySetting%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EId%20%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EGet-AzureADDirectorySetting%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3Ewhere%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EProperty%20DisplayName%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EValue%20%3C%2FSPAN%3E%3CSPAN%3E%22Group.Unified%22%3C%2FSPAN%3E%20%3CSPAN%3E-EQ%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E.id%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3Eits%20empty%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CP%3EGet-AzureADDirectorySetting%20%3A%20Cannot%20bind%20argument%20to%20parameter%20'Id'%20because%20it%20is%20null.%3CBR%20%2F%3EAt%20line%3A1%20char%3A44%3CBR%20%2F%3E%2B%20...%20Setting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayNam%20...%3CBR%20%2F%3E%2B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20InvalidData%3A%20(%3A)%20%5BGet-AzureADDirectorySetting%5D%2C%20ParameterBindingValidationException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20ParameterArgumentValidationErrorNullNotAllowed%2CMicrosoft.Open.MSGraphBeta.PowerShell.GetDirectorySetting%3C%2FP%3E%0A%3CP%3ECannot%20index%20into%20a%20null%20array.%3CBR%20%2F%3EAt%20line%3A3%20char%3A1%3CBR%20%2F%3E%2B%20%24Setting%5B%22PrefixSuffixNamingRequirement%22%5D%20%3D%20%E2%80%9C%5BCompany%5D-%5BGroupName%5D%22%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20InvalidOperation%3A%20(%3A)%20%5B%5D%2C%20RuntimeException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20NullArray%3C%2FP%3E%0A%3CP%3ESet-AzureADDirectorySetting%20%3A%20Cannot%20bind%20argument%20to%20parameter%20'Id'%20because%20it%20is%20null.%3CBR%20%2F%3EAt%20line%3A4%20char%3A33%3CBR%20%2F%3E%2B%20...%20Setting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayNam%20...%3CBR%20%2F%3E%2B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20InvalidData%3A%20(%3A)%20%5BSet-AzureADDirectorySetting%5D%2C%20ParameterBindingValidationException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20ParameterArgumentValidationErrorNullNotAllowed%2CMicrosoft.Open.MSGraphBeta.PowerShell.SetDirectorySetting%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170688%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170688%22%20slang%3D%22en-US%22%3E%3CP%3EHere%20is%20an%20example%20in%20addition%20to%20the%20documentation%2C%20note%20the%20policy%20does%20not%20apply%20when%20you%20are%20logged%20in%20as%20an%20administrator%20so%20you%20will%20need%20to%20test%20with%20a%20'regular%22%20end%20user%20%2B%20see%20this%20as%20well%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Foffice-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d469dfbbb552%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Foffice-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d469dfbbb552%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%24Setting%20%3D%20Get-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%3CBR%20%2F%3E%24Setting%5B%22CustomBlockedWordsList%22%5D%3D%E2%80%9Ccontoso%2Cpayroll%2Cceo%2Ccfo%2Chr%2Csales%2Cmarketing%2Cinfo%2Cadmin%2Cnull%2Cvulgar%2Cass%2Cshit%2Czut%2Cmerde%22%3CBR%20%2F%3E%24Setting%5B%22PrefixSuffixNamingRequirement%22%5D%3D%E2%80%9CG_%5BGroupName%5D_%5BDepartment%5D%22%3C%2FP%3E%0A%3CP%3ESet-AzureADDirectorySetting%20-Id%20(Get-AzureADDirectorySetting%20%7C%20where%20-Property%20DisplayName%20-Value%20%22Group.Unified%22%20-EQ).id%20-DirectorySetting%20%24Setting%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170649%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170649%22%20slang%3D%22en-US%22%3E%3CP%3EThere's%20a%20list%20on%20this%20post%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fgroups-naming-policy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fgroups-naming-policy%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20class%3D%22heading-with-anchor%22%20id%3D%22user-attributes%22%20id%3D%22toc-hId-1228683490%22%20id%3D%22toc-hId-1396729812%22%20id%3D%22toc-hId-1228683490%22%3EUser%20attributes%3C%2FH4%3E%0A%3CP%3EYou%20can%20use%20attributes%20that%20can%20help%20you%20and%20your%20users%20identify%20which%20department%2C%20office%20or%20geographic%20region%20for%20which%20the%20group%20was%20created.%20For%20example%2C%20if%20you%20define%20your%20naming%20policy%20as%3CCODE%3EPrefixSuffixNamingRequirement%20%3D%20%E2%80%9CGRP%20%5BGroupName%5D%20%5BDepartment%5D%E2%80%9D%3C%2FCODE%3E%2C%20and%20%3CCODE%3EUser%E2%80%99s%20department%20%3D%20Engineering%3C%2FCODE%3E%2C%20then%20an%20enforced%20group%20name%20might%20be%20%E2%80%9CGRP%20My%20Group%20Engineering.%22%20Supported%20Azure%20AD%20attributes%20are%20%5BDepartment%5D%2C%20%5BCompany%5D%2C%20%5BOffice%5D%2C%20%5BStateOrProvince%5D%2C%20%5BCountryOrRegion%5D%2C%20%5BTitle%5D.%20Unsupported%20user%20attributes%20are%20treated%20as%20fixed%20strings%3B%20for%20example%2C%20%E2%80%9C%5BpostalCode%5D%E2%80%9D.%20Extension%20attributes%20and%20custom%20attributes%20aren't%20supported.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170642%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170642%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20%5BCompany%5D%20actually%20one%20of%20the%20available%20options%3F%26nbsp%3B%20Maybe%20it's%20'companyname'%2C%20or%20something%20else%3F%26nbsp%3B%20I%20haven't%20started%20playing%20with%20the%20AAD%20components%20yet%2C%20but%20that's%20a%20guess.%26nbsp%3B%20I'd%20like%20to%20see%20a%20list%20of%20accepted%20attributes%20if%20one%20exists.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170640%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170640%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20had%20a%20lot%20of%20success%20configuring%20and%20using%20the%20Groups%20AAD%20settings%20last%20week%2C%20with%20one%20exception%3A%26nbsp%3B%20Naming%20Policy.%26nbsp%3B%20Below%20is%20the%20output%20from%20the%20Groups%20Settings%20I%20have%20in%20place.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20cannot%20get%20the%20%22O365Grp-%5BGroupName%5D%22%20prefix%20to%20be%20generated%20on%20any%20new%20groups.%26nbsp%3B%20Based%20on%20the%20research%20I%20did%2C%20the%20brackets%20serve%20to%20insert%20the%20actual%20group%20name%2C%20and%20it's%20just%20not%20happening.%26nbsp%3B%20When%20I%20created%20the%20'PrefixSuffixNamingRequirement'%20setting%2C%20I%20didn't%20get%20an%20error.%26nbsp%3B%20I've%20also%20changed%20it%20around%20a%20bit%2C%20to%20include%2Fexclude%20the%20%5BGroupName%5D%20component%20but%20nothing%20made%20any%20difference.%3C%2FP%3E%0A%3CP%3EAny%20suggestions%20are%20appreciated.%3C%2FP%3E%0A%3CP%3EThx%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20suggestions%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20783px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30182i094894033B858BE0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22GroupsPolicy.png%22%20title%3D%22GroupsPolicy.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-170512%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170512%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20create%20a%20new%20policy%20with%20the%20command%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESet-AzureADDirectorySetting%20-Id%20group-policy%20-DirectorySetting%20%E2%80%9C%5BCompany%5D-%22%3C%2FPRE%3E%0A%3CP%3EI'm%20getting%20an%20error%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESet-AzureADDirectorySetting%20%3A%20Cannot%20bind%20parameter%20'DirectorySetting'.%20Cannot%20convert%20the%20%22%5BCompany%5D-%22%20value%20of%20type%20%22System.String%22%20to%20type%20%22Microsoft.Open.MSGraph.Model.DirectorySetting%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20ideas%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-168039%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-168039%22%20slang%3D%22en-US%22%3E%3CP%3EJason%20it%20only%20applies%20to%20net%20new%20created%20groups%20and%20it%20does%20not%20update%20existing%20ones%2C%20please%20see%20this%20article%20for%20more%20details%2C%20please%20note%20it's%20a%20%22Public%20Preview%22%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Foffice-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d469dfbbb552%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Foffice-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d469dfbbb552%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-790181%22%20slang%3D%22en-US%22%3ERe%3A%20Enforce%20naming%20conventions%20across%20Office%20365%20Groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-790181%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20a%20lot!%20This%20was%20essential%20in%20order%20to%20get%20Move-StaffHubTeam%20to%20work!%20The%20documentation%20is%2C%20to%20put%20it%20mildly%2C%20incomplete%20and%20misleading...%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

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

16 Replies

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-d46...

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?

 

 

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?

 

 

GroupsPolicy.png

Is [Company] actually one of the available options?  Maybe it's 'companyname', or something else?  I haven't started playing with the AAD components yet, but that's a guess.  I'd like to see a list of accepted attributes if one exists.

There's a list on this post

 

https://docs.microsoft.com/en-us/azure/active-directory/groups-naming-policy

 

User attributes

You can use attributes that can help you and your users identify which department, office or geographic region for which the group was created. For example, if you define your naming policy as PrefixSuffixNamingRequirement = “GRP [GroupName] [Department]”, and User’s department = Engineering, then an enforced group name might be “GRP My Group Engineering." Supported Azure AD attributes are [Department], [Company], [Office], [StateOrProvince], [CountryOrRegion], [Title]. Unsupported user attributes are treated as fixed strings; for example, “[postalCode]”. Extension attributes and custom attributes aren't supported.

Here is an example in addition to the documentation, note the policy does not apply when you are logged in as an administrator so you will need to test with a 'regular" end user + see this as well: https://support.office.com/en-us/article/office-365-groups-naming-policy-6ceca4d3-cad1-4532-9f0f-d46...

 

$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

Get-AzureADDirectorySetting 

returns nothing, so when I try to run 

 

$Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id
 
its empty
 

Get-AzureADDirectorySetting : Cannot bind argument to parameter 'Id' because it is null.
At line:1 char:44
+ ... Setting -Id (Get-AzureADDirectorySetting | where -Property DisplayNam ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-AzureADDirectorySetting], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Open.MSGraphBeta.PowerShell.GetDirectorySetting

Cannot index into a null array.
At line:3 char:1
+ $Setting["PrefixSuffixNamingRequirement"] = “[Company]-[GroupName]"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Set-AzureADDirectorySetting : Cannot bind argument to parameter 'Id' because it is null.
At line:4 char:33
+ ... Setting -Id (Get-AzureADDirectorySetting | where -Property DisplayNam ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Set-AzureADDirectorySetting], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Open.MSGraphBeta.PowerShell.SetDirectorySetting

best response confirmed by Jason Benway (Contributor)
Solution

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

Thank you, this was the part I was missing!

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

I'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.

Kindly suggest what is wrong happening here, Tried everything in Directory Parameter.

 

PS C:\WINDOWS\system32> Get-AzureADGroup -SearchString "AllowedtocreateO365Groups"

ObjectId DisplayName Description
-------- ----------- -----------
ad5ceeae-033f-46e8-99dd-fbc570bbc0e8 AllowedtocreateO365Groups


PS C:\WINDOWS\system32> Get-AzureADGroup -SearchString "AllowedtocreateO365Groups"

ObjectId DisplayName Description
-------- ----------- -----------
ad5ceeae-033f-46e8-99dd-fbc570bbc0e8 AllowedtocreateO365Groups


PS C:\WINDOWS\system32> $Template = Get-AzureADDirectorySettingTemplate | where {$_.DisplayName -eq 'Group.Unified'}
PS C:\WINDOWS\system32> $Setting = $Template.CreateDirectorySetting()
PS C:\WINDOWS\system32> New-AzureADDirectorySetting -DirectorySetting $Setting
New-AzureADDirectorySetting : Error occurred while executing NewDirectorySetting
StatusCode: BadRequest
ErrorCode: Request_BadRequest
Message: A conflicting object with one or more of the specified property values is present in the directory.
At line:1 char:1
+ New-AzureADDirectorySetting -DirectorySetting $Setting
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureADDirectorySetting], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.MSGraphBeta.Client.ApiException,Microsoft.Open.MSGraphBeta.PowerShell.NewDirectorySetting

PS C:\WINDOWS\system32> Get-AzureADDirectorySetting

Id DisplayName TemplateId Values
-- ----------- ---------- ------
0dd206ca-7d7d-4649-bb2e-ca8246f11a3e Group.Unified 62375ab9-6b52-47ed-826b-58e47e0e304b {class SettingValue {...


PS C:\WINDOWS\system32> $Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id
Get-AzureADDirectorySetting : A parameter cannot be found that matches parameter name 'Id'.
At line:1 char:40
+ $Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetti ...
+ ~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureADDirectorySetting], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Open.MSGraphBeta.PowerShell.GetDirectorySetting

PS C:\WINDOWS\system32> $Setting = Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ
PS C:\WINDOWS\system32> $Setting["EnableGroupCreation"] = $False
PS C:\WINDOWS\system32> $Setting["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString "AllowedtocreateO365Groups").objectid
PS C:\WINDOWS\system32> Set-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ -DirectorySetting $Setting

cmdlet Set-AzureADDirectorySetting at command pipeline position 1
Supply values for the following parameters:
DirectorySetting: AllowedtocreateO365Groups
Set-AzureADDirectorySetting : Cannot bind parameter 'DirectorySetting'. Cannot convert the "AllowedtocreateO365Groups" value of type "System.String" to type "Microsoft.Open.MSGraph.Model.DirectorySetting".
At line:1 char:1
+ Set-AzureADDirectorySetting | where -Property DisplayName -Value "Gr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-AzureADDirectorySetting], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Open.MSGraphBeta.PowerShell.SetDirectorySetting

PS C:\WINDOWS\system32> $setting

Id DisplayName TemplateId Values
-- ----------- ---------- ------
0dd206ca-7d7d-4649-bb2e-ca8246f11a3e Group.Unified 62375ab9-6b52-47ed-826b-58e47e0e304b {class SettingValue {...


PS C:\WINDOWS\system32> (Get-AzureADDirectorySetting).values

Name Value
---- -----
CustomBlockedWordsList
EnableMSStandardBlockedWords False
ClassificationDescriptions
DefaultClassification
PrefixSuffixNamingRequirement
AllowGuestsToBeGroupOwner False
AllowGuestsToAccessGroups True
GuestUsageGuidelinesUrl
GroupCreationAllowedGroupId
AllowToAddGuests True
UsageGuidelinesUrl
ClassificationList
EnableGroupCreation True


PS C:\WINDOWS\system32>

 

 

Lots of errors in your multiple cmdlets, please follow the step by step from this article: https://support.office.com/en-us/article/Manage-who-can-create-Office-365-Groups-4c46c8cb-17d0-44b5-...

Hello Sir,

I generated those error in my question to show you. And I am following the same article.

-----------------------------------------------------------------------

New-AzureADDirectorySetting -DirectorySetting $Setting - Here is an error in the original post and it is expected as per the article.

----------------------------------------------------------------------

$Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id
Get-AzureADDirectorySetting : A parameter cannot be found that matches parameter name 'Id'

- According to error, I did a little different but same task.

$Setting = Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ

So I have proceeded further.

----------------------------------------------------------------------------------------

on Last step, I am struggling

Set-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ -DirectorySetting $Setting

 

It is not recognizing $settings parameter...tried different values. 

----------------------------------------------------

And in My original post, you can see I have posted in last $setting parameter value as to eliminate the doubt of null value.

-----------------------------------------------------

May I request you to provide your comment on this? It would be grateful.

 

 

Thank you sir for your response. It worked by this. And I am cursing myself why didn't i try tab before.

 

Set-AzureADDirectorySetting -ObjectId $settings.Id -DirectorySetting $settings

 

-objectID instead of -id

 

Have a great day.

Thanks a lot! This was essential in order to get Move-StaffHubTeam to work! The documentation is, to put it mildly, incomplete and misleading...