Home
%3CLINGO-SUB%20id%3D%22lingo-sub-362243%22%20slang%3D%22en-US%22%3EPlanner%3A%20Group%20control%E2%80%93new%20PowerShell%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-362243%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Apr%2007%2C%202017%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Since%20posting%20my%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fbrismith%2F2016%2F06%2F07%2Fmicrosoft-planner-another-look-as-msolsettingsand-a-couple-more-answers%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20blogs%20%3C%2FA%3E%20that%20covered%20control%20of%20Group%20creation%20using%20PowerShell%20as%20a%20means%20of%20setting%20who%20can%20and%20cannot%20create%20Plans%20(which%20create%20Groups)%20there%20has%20been%20a%20new%20release%20of%20the%20Azure%20AD%20PowerShell%20module%20which%20supersedes%20the%20%E2%80%98v1%20Preview%E2%80%99%20that%20contained%20the%20earlier%20commands%20%E2%80%93%20such%20as%20Get-MSOLAllSettingTemplate%20and%20New-MsolSettings.%26nbsp%3B%20The%20new%20modules%20are%20still%20%E2%80%98Preview%E2%80%99%20but%20in%20v2%20and%20the%20new%20module%20details%20can%20be%20found%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Factive-directory-accessmanagement-groups-settings-cmdlets%22%20title%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Factive-directory-accessmanagement-groups-settings-cmdlets%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Factive-directory-accessmanagement-groups-settings-cmdlets%20%3C%2FA%3E%20and%20the%20PowerShell%20v2%20Preview%20module%20can%20be%20installed%20in%20PowerShell%20using%20the%20following%20command%20from%20within%20PowerShell%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3Einstall-module%20-Name%20AzureADPreview%20-RequiredVersion%202.0.0.85%20(always%20use%20the%20latest%20available)%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20***%20Update%201%2F5%2F2018%20-%20best%20to%20use%20the%20latest%20here%20rather%20than%20the%20version%20I%20specify%20above%20-%20as%20things%20invariably%20move%20on%20(Thanks%20Rob%20Whaley%20for%20keeping%20me%20honest%20here%20and%20suggesting%20the%20update!)%20***%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20I%E2%80%99m%20guessing%20this%20will%20get%20updated%20%E2%80%93%20I%20only%20show%20that%20version%20as%20that%20is%20the%203%2F17%2F2017%20release%20that%20you%20need%20%E2%80%93%20and%20that%20command%20will%20ensure%20that%20any%20earlier%20versions%20you%20may%20have%20installed%20are%20updated.%26nbsp%3B%20As%20with%20all%20Azure%20AD%20commands%20%E2%80%93%20the%20first%20thing%20you%20will%20need%20to%20do%20is%20connect%20and%20log%20in%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EConnect-AzureAD%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20This%20will%20pop%20up%20a%20login%20dialog%20%E2%80%93%20just%20use%20your%20Office%20365%20credentials%20(I%E2%80%99m%20assuming%20you%20are%20an%20admin)%20and%20you%20should%20see%20your%20Account%2C%20Environment%20and%20Tenant%20details%20returned.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20The%20logic%20for%20controlling%20group%20creation%20is%20pretty%20much%20the%20same%20%E2%80%93%20and%20builds%20on%20the%20previous%20commands%20such%20that%20the%20new%20commands%20will%20read%20the%20previous%20settings.%26nbsp%3B%20For%20example%20I%20can%20use%20the%20new%20commands%20to%20read%20current%20settings%20to%20see%20what%20I%20have%20set%20in%20my%20test%20tenant.%26nbsp%3B%20Get-AzureADDirectorySetting%20replaces%20Get-MsolAllSettings.%26nbsp%3B%20The%20old%20commands%20will%20still%20work%20if%20you%20have%20the%20v1%20Preview%20module%20installed%20%E2%80%93%20but%20you%20can%20no%20longer%20download%20the%20v1%20Preview%20module%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EGet-AzureADDirectorySetting%20-All%20%24true%20%7C%20Format-Table%20Id%2C%20DisplayName%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20This%20returns%20a%20formatted%20table%20just%20showing%20the%20Id%20and%20name%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EId%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%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%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%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%20DisplayName%20%3CBR%20%2F%3E%20--%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%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%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%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-----------%20%3CBR%20%2F%3E%2078589c63-72cd-47d2-a187-86092a5f16e7%26nbsp%3B%26nbsp%3B%20Group.Unified%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20To%20enumerate%20all%20the%20settings%20values%20we%20can%20use%20the%20new%20command%20Get-AzureADDirectorySetting%20with%20the%20%E2%80%93All%20parameter%20set%20to%20true%20then%20loop%20through%20the%20objects%20(settings)%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EGet-AzureADDirectorySetting%20-All%20%24True%20%7C%20where-object%20%7B%24_.DisplayName%20-eq%20%22Group.Unified%22%7D%20%7C%20ForEach-Object%20Values%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20This%20returns%20my%20current%20settings%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EName%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%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%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%26nbsp%3B%20Value%20%3CBR%20%2F%3E%20----%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%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%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-----%20%3CBR%20%2F%3E%20ClassificationDescriptions%20%3CBR%20%2F%3E%20DefaultClassification%20%3CBR%20%2F%3E%20PrefixSuffixNamingRequirement%20%3CBR%20%2F%3E%20AllowGuestsToBeGroupOwner%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%20False%20%3CBR%20%2F%3E%20AllowGuestsToAccessGroups%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%20True%20%3CBR%20%2F%3E%20GuestUsageGuidelinesUrl%20%3CBR%20%2F%3E%20GroupCreationAllowedGroupId%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%207edd1d0b-557d-43e6-b583-4f3e0198c167%20%3CBR%20%2F%3E%20AllowToAddGuests%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%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%20True%20%3CBR%20%2F%3E%20UsageGuidelinesUrl%20%3CBR%20%2F%3E%20ClassificationList%20%3CBR%20%2F%3E%20EnableGroupCreation%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20False%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20If%20you%20are%20watching%20closely%20you%20will%20notice%20there%20are%20a%20few%20more%20settings%20now%20compared%20to%20v1%2C%20and%20I%20have%20highlighted%20the%20new%20ones.%26nbsp%3B%20I%E2%80%99ll%20concentrate%20of%20the%20lower%20ones%20in%20this%20post%20as%20the%20other%20ones%20don%E2%80%99t%20really%20affect%20Planner%20(yet)%20but%20soon%20they%20will%20%E2%80%93%20and%20I%20will%20post%20again!%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20My%20configuration%20is%20to%20only%20allow%20my%20users%20to%20create%20Groups%20if%20they%20are%20in%20the%20Group%20with%20Id%20of%207edd1d0b-557d-43e6-b583-4f3e0198c167.%26nbsp%3B%20I%20can%20use%20the%20following%20command%20to%20get%20that%20group%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EGet-AzureADGroup%20-ObjectId%207edd1d0b-557d-43e6-b583-4f3e0198c167%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20ObjectId%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%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%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DisplayName%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%20Description%20%3CBR%20%2F%3E%20--------%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%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%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-----------%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%26nbsp%3B%26nbsp%3B%20-----------%20%3CBR%20%2F%3E%207edd1d0b-557d-43e6-b583-4f3e0198c167%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CanCreateGroups%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Users%20allowed%20to%20create%20groups%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20Everything%20is%20set%20as%20it%20was%20before%20when%20I%20used%20the%20old%20Msol%20commands%20%E2%80%93%20but%20if%20I%20was%20starting%20from%20scratch%20what%20would%20I%20do%3F%26nbsp%3B%20I%20can%20start%20by%20removing%20my%20settings%20and%20walk%20through%20the%20steps%20to%20get%20them%20back%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%24SettingId%20%3D%20Get-AzureADDirectorySetting%20-All%20%24True%20%7C%20where-object%20%7B%24_.DisplayName%20-eq%20%22Group.Unified%22%7D%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Remove-AzureADDirectorySetting%20-Id%20%24SettingId.Id%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20The%20steps%20to%20create%20a%20new%20set%20of%20settings%20are%20to%20read%20the%20settings%20template%20for%20unified%20groups%2C%20then%20set%20the%20settings%20and%20finally%20to%20save%20as%20a%20new%20set%20of%20settings.%26nbsp%3B%20All%20set%3F%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%24template%20%3D%20Get-AzureADDirectorySettingTemplate%20%7C%20where-object%20%7B%24_.DisplayName%20-eq%20%22Group.Unified%22%7D%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20If%20you%20take%20a%20look%20at%20the%20%24Template%20object%20while%20you%20have%20it%20in%20PowerShell%20then%20the%20%24Template.Values%20%7C%20fl%20gives%20a%20nice%20list%20of%20the%20names%20and%20descriptions%20of%20the%20settings%20if%20you%20are%20interested%20in%20trying%20out%20some%20of%20the%20others.%26nbsp%3B%20For%20now%20I%E2%80%99m%20just%20going%20to%20set%20the%20ones%20I%E2%80%99m%20interested%20in.%26nbsp%3B%20I%E2%80%99m%20also%20going%20to%20hard%20code%20the%20GroupId%20%E2%80%93%20but%20at%20the%20foot%20of%20this%20blog%20I%E2%80%99ll%20include%20a%20couple%20of%20options%20to%20populate%20a%20variable%20with%20specific%20groups%3A%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%24settings%20%3D%20%24template.CreateDirectorySetting()%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24settings%5B%22GroupCreationAllowedGroupId%22%5D%20%3D%20'7edd1d0b-557d-43e6-b583-4f3e0198c167'%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24settings%5B%22AllowToAddGuests%22%5D%20%3D%20%22true%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24settings%5B%22UsageGuidelinesUrl%22%5D%20%3D%20%22%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2Fo365g%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20http%3A%2F%2Faka.ms%2Fo365g%20%3C%2FA%3E%20%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24settings%5B%22ClassificationList%22%5D%20%3D%20%22Low%2CMedium%2CHigh%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24settings%5B%22EnableGroupCreation%22%5D%20%3D%20%22false%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20New-AzureADDirectorySetting%20-DirectorySetting%20%24settings%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20And%20then%20I%20can%20confirm%20these%20are%20set%20using%20the%20same%20command%20as%20above%20Get-AzureADDirectorySetting%20-All%20%24True%20%7C%20where-object%20%7B%24_.DisplayName%20-eq%20%22Group.Unified%22%7D%20%7C%20ForEach-Object%20Values%20and%20I%20see%20these%20settings%20%E2%80%93%20some%20of%20the%20ones%20I%20didn%E2%80%99t%20set%20take%20their%20default%20values.%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3EName%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%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Value%20%3CBR%20%2F%3E%20----%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%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%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-----%20%3CBR%20%2F%3E%20ClassificationDescriptions%20%3CBR%20%2F%3E%20DefaultClassification%20%3CBR%20%2F%3E%20PrefixSuffixNamingRequirement%20%3CBR%20%2F%3E%20AllowGuestsToBeGroupOwner%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20False%20%3CBR%20%2F%3E%20AllowGuestsToAccessGroups%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20True%20%3CBR%20%2F%3E%20GuestUsageGuidelinesUrl%20%3CBR%20%2F%3E%20GroupCreationAllowedGroupId%26nbsp%3B%26nbsp%3B%207edd1d0b-557d-43e6-b583-4f3e0198c167%20%3CBR%20%2F%3E%20AllowToAddGuests%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20True%20%3CBR%20%2F%3E%20UsageGuidelinesUrl%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2Fo365g%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Http%3A%2F%2Faka.ms%2Fo365g%20%3C%2FA%3E%20%3CBR%20%2F%3E%20ClassificationList%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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Low%2CMedium%2CHigh%20%3CBR%20%2F%3E%20EnableGroupCreation%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%26nbsp%3B%20False%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20As%20before%20you%20can%20re-open%20the%20settings%20object%20to%20update%20the%20values%20%E2%80%93%20or%20sometimes%20easier%20to%20remove%20and%20re-create%20as%20I%20have%20here.%26nbsp%3B%20I%20haven%E2%80%99t%20checked%20in%20v2%20Preview%20%E2%80%93%20but%20in%20v1%20if%20you%20removed%20then%20the%20settings%20still%20held%20true%20%E2%80%93%20you%20needed%20to%20set%20the%20EnableGroupCreation%20to%20True%20rather%20than%20just%20remove%20the%20settings.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Thanks%20to%20Rob%20de%20Jong%20and%20Rob%20Whaley%20for%20their%20guidance%20and%20input%20on%20using%20these%20new%20commands%2C%20and%20particularly%20the%202nd%20Rob%20for%20these%20commands%20to%20set%20a%20variable%20to%20use%20as%20the%20%E2%80%98allowed%E2%80%99%20group%20%E2%80%93%20where%20%24GlobalAdminsObjectID%20can%20be%20used%20in%20place%20of%20my%20hard-coded%20group.%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%23%20If%20we%20want%20to%20control%20who%20can%20create%20groups%20we%20can%20do%20the%20following%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%23%20We%20can%20use%20this%20for%20canned%20Azure%20Roles%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24GlobalAdmins%20%3D%20Get-AzureADDirectoryRole%20%7C%20%3F%20%7B%20%24_.DisplayName%20-like%20%22Company%20Administrator%22%7D%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24GlobalAdminsObjectID%20%3D%20%24GlobalAdmins.ObjectId.ToString()%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%23%20Or%20we%20can%20create%20a%20security%20group%20and%20set%20its%20object%20id%20as%20a%20variable%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20New-AzureADGroup%20-Description%20%22Security%20Group%20for%20users%20allowed%20to%20create%20Office%20365%20Groups%22%20-DisplayName%20%22Office%20365%20Group%20Creators%22%20-MailEnabled%20%24false%20-SecurityEnabled%20%24true%20-MailNickName%20%22O365GC%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24GlobalAdminsObjectID%20%3D%20(Get-AzureADGroup%20-SearchString%20%22Office%20365%20Group%20Creators%22).ObjectId.ToString()%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%23%20Or%20we%20can%20call%20an%20existing%20security%20group%20and%20set%20its%20object%20id%20as%20a%20variable%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24GlobalAdminsObjectID%20%3D%20%22b39e2044-a139-4463-8c9a-4578e43676ca%22%3C%2FBLOCKQUOTE%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-362243%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Apr%2007%2C%202017%20Since%20posting%20my%20blogs%20that%20covered%20control%20of%20Group%20creation%20using%20PowerShell%20as%20a%20means%20of%20setting%20who%20can%20and%20cannot%20create%20Plans%20(which%20create%20Groups)%20there%20has%20been%20a%20new%20release%20of%20the%20Azure%20AD%20PowerShell%20module%20which%20supersedes%20the%20%E2%80%98v1%20Preview%E2%80%99%20that%20contained%20the%20earlier%20commands%20%E2%80%93%20such%20as%20Get-MSOLAllSettingTemplate%20and%20New-MsolSettings.%3C%2FLINGO-TEASER%3E
First published on MSDN on Apr 07, 2017
Since posting my blogs that covered control of Group creation using PowerShell as a means of setting who can and cannot create Plans (which create Groups) there has been a new release of the Azure AD PowerShell module which supersedes the ‘v1 Preview’ that contained the earlier commands – such as Get-MSOLAllSettingTemplate and New-MsolSettings.  The new modules are still ‘Preview’ but in v2 and the new module details can be found at https://docs.microsoft.com/en-us/azure/active-directory/active-directory-accessmanagement-groups... and the PowerShell v2 Preview module can be installed in PowerShell using the following command from within PowerShell:
install-module -Name AzureADPreview -RequiredVersion 2.0.0.85 (always use the latest available)

*** Update 1/5/2018 - best to use the latest here rather than the version I specify above - as things invariably move on (Thanks Rob Whaley for keeping me honest here and suggesting the update!) ***

I’m guessing this will get updated – I only show that version as that is the 3/17/2017 release that you need – and that command will ensure that any earlier versions you may have installed are updated.  As with all Azure AD commands – the first thing you will need to do is connect and log in:
Connect-AzureAD

This will pop up a login dialog – just use your Office 365 credentials (I’m assuming you are an admin) and you should see your Account, Environment and Tenant details returned.

The logic for controlling group creation is pretty much the same – and builds on the previous commands such that the new commands will read the previous settings.  For example I can use the new commands to read current settings to see what I have set in my test tenant.  Get-AzureADDirectorySetting replaces Get-MsolAllSettings.  The old commands will still work if you have the v1 Preview module installed – but you can no longer download the v1 Preview module:
Get-AzureADDirectorySetting -All $true | Format-Table Id, DisplayName

This returns a formatted table just showing the Id and name:
Id                                                              DisplayName
--                                                                -----------
78589c63-72cd-47d2-a187-86092a5f16e7   Group.Unified

To enumerate all the settings values we can use the new command Get-AzureADDirectorySetting with the –All parameter set to true then loop through the objects (settings):
Get-AzureADDirectorySetting -All $True | where-object {$_.DisplayName -eq "Group.Unified"} | ForEach-Object Values

This returns my current settings:
Name                                                  Value
----                                                      -----
ClassificationDescriptions
DefaultClassification
PrefixSuffixNamingRequirement
AllowGuestsToBeGroupOwner               False
AllowGuestsToAccessGroups                 True
GuestUsageGuidelinesUrl
GroupCreationAllowedGroupId              7edd1d0b-557d-43e6-b583-4f3e0198c167
AllowToAddGuests                                True
UsageGuidelinesUrl
ClassificationList
EnableGroupCreation                            False

If you are watching closely you will notice there are a few more settings now compared to v1, and I have highlighted the new ones.  I’ll concentrate of the lower ones in this post as the other ones don’t really affect Planner (yet) but soon they will – and I will post again!

My configuration is to only allow my users to create Groups if they are in the Group with Id of 7edd1d0b-557d-43e6-b583-4f3e0198c167.  I can use the following command to get that group:
Get-AzureADGroup -ObjectId 7edd1d0b-557d-43e6-b583-4f3e0198c167

ObjectId                                                        DisplayName              Description
--------                                                          -----------                   -----------
7edd1d0b-557d-43e6-b583-4f3e0198c167      CanCreateGroups       Users allowed to create groups

Everything is set as it was before when I used the old Msol commands – but if I was starting from scratch what would I do?  I can start by removing my settings and walk through the steps to get them back:
$SettingId = Get-AzureADDirectorySetting -All $True | where-object {$_.DisplayName -eq "Group.Unified"}

Remove-AzureADDirectorySetting -Id $SettingId.Id

The steps to create a new set of settings are to read the settings template for unified groups, then set the settings and finally to save as a new set of settings.  All set?
$template = Get-AzureADDirectorySettingTemplate | where-object {$_.DisplayName -eq "Group.Unified"}

If you take a look at the $Template object while you have it in PowerShell then the $Template.Values | fl gives a nice list of the names and descriptions of the settings if you are interested in trying out some of the others.  For now I’m just going to set the ones I’m interested in.  I’m also going to hard code the GroupId – but at the foot of this blog I’ll include a couple of options to populate a variable with specific groups:
$settings = $template.CreateDirectorySetting()

$settings["GroupCreationAllowedGroupId"] = '7edd1d0b-557d-43e6-b583-4f3e0198c167'

$settings["AllowToAddGuests"] = "true"

$settings["UsageGuidelinesUrl"] = " http://aka.ms/o365g "

$settings["ClassificationList"] = "Low,Medium,High"

$settings["EnableGroupCreation"] = "false"

New-AzureADDirectorySetting -DirectorySetting $settings

And then I can confirm these are set using the same command as above Get-AzureADDirectorySetting -All $True | where-object {$_.DisplayName -eq "Group.Unified"} | ForEach-Object Values and I see these settings – some of the ones I didn’t set take their default values.
Name                                          Value
----                                              -----
ClassificationDescriptions
DefaultClassification
PrefixSuffixNamingRequirement
AllowGuestsToBeGroupOwner     False
AllowGuestsToAccessGroups       True
GuestUsageGuidelinesUrl
GroupCreationAllowedGroupId   7edd1d0b-557d-43e6-b583-4f3e0198c167
AllowToAddGuests                      True
UsageGuidelinesUrl Http://aka.ms/o365g
ClassificationList                          Low,Medium,High
EnableGroupCreation                  False

As before you can re-open the settings object to update the values – or sometimes easier to remove and re-create as I have here.  I haven’t checked in v2 Preview – but in v1 if you removed then the settings still held true – you needed to set the EnableGroupCreation to True rather than just remove the settings.

Thanks to Rob de Jong and Rob Whaley for their guidance and input on using these new commands, and particularly the 2nd Rob for these commands to set a variable to use as the ‘allowed’ group – where $GlobalAdminsObjectID can be used in place of my hard-coded group.
# If we want to control who can create groups we can do the following:

# We can use this for canned Azure Roles:

$GlobalAdmins = Get-AzureADDirectoryRole | ? { $_.DisplayName -like "Company Administrator"}

$GlobalAdminsObjectID = $GlobalAdmins.ObjectId.ToString()

# Or we can create a security group and set its object id as a variable:

New-AzureADGroup -Description "Security Group for users allowed to create Office 365 Groups" -DisplayName "Office 365 Group Creators" -MailEnabled $false -SecurityEnabled $true -MailNickName "O365GC"

$GlobalAdminsObjectID = (Get-AzureADGroup -SearchString "Office 365 Group Creators").ObjectId.ToString()

# Or we can call an existing security group and set its object id as a variable:

$GlobalAdminsObjectID = "b39e2044-a139-4463-8c9a-4578e43676ca"