Forum Discussion
Use PowerShell to check the group-based licensing option in Azure AD for Microsoft 365 Groups!
Hi Microsoft 365 and Azure Friends,
This article is about the following scenario:
When you create a new Microsoft 365 group in the Microsoft 365 portal, you cannot work with group licensing in Azure Active Directory because the group's SecurityEnabled property has the value "false".
If you create a new Microsoft 365 group in Azure Active Directory, you can work with group licensing in Azure AD because the SecurityEnabled property has a value of "true".
Let's explore this together.
I used the PowerShell ISE for this configuration. But you are also very welcome to use Visual Studio Code, just as you wish. Please start with the following steps to begin the deployment (the Hashtags are comments):
#The first two lines have nothing to do with the configuration, but make some space below in the blue part of the ISE
Set-Location C:\Temp
Clear-Host
#If needed
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
#Install the AzureAD
Install-Module -Name AzureAD -AllowClobber -Verbose -Force
#Connect
Connect-AzureAD
#Did it work?
Get-AzureADUser
#Get an existing group (created in the Azure Active Directory Portal)
Get-AzureADMSGroup -SearchString "Logistik"
#Get the SecurityEnabled value (the value "true" comes back)
(Get-AzureADMSGroup -SearchString "Logistik").SecurityEnabled
#Get an existing group (created in the Microsoft 365 Admin Center)
Get-AzureADMSGroup -SearchString "Technik"
#Get the SecurityEnabled value (the value "false" comes back)
(Get-AzureADMSGroup -SearchString "Technik").SecurityEnabled
Now let's have a look at the Azure Active Directory Portal => navigate to groups => Under Manage we do not find a license option!
#We change the SecurityEnabled property (get the group Id from above)
Set-AzureADMSGroup -Id a8269c21-1059-4bb1-8937-7f2d6a6f6b92 -SecurityEnabled $True
Let's check it out in Azure Active Directory! Now we have the option of group licensing.
Sure this wasn't super exciting, but I still wanted to share this information with you. I hope this article was helpful for you? Thank you for taking the time to read this article.
Best regards, Tom Wechsler
P.S. All scripts (#PowerShell, Azure CLI, #Terraform, #ARM) that I use can be found on github! https://github.com/tomwechsler