Dynamic Groups in Azure AD


Have tried to use the advanced queries and heres an example of an advanced query:

This query will add members:

UserPrincipalName Starts with e, u or b
UserPrincipalName Match @domain.com and Account is Enabled and UserType is Member


Classifications for Office365 Groups and Microsoft Teams

These commands are a part of the Azure Active Directory Powershell V2 module.

Install the AzureAD or the AzureADPreview Module

Connect to Azure AD

Verify if the Directory Settings exists

If no result, the settings are not created and you will need to create it first.

Creating the Classifications if no Directory Settings exists

Creating the Classifications if Directory Settings exists

Configuring the Default Classification for Office365 Groups

Manually assign Classifications to Office365 Groups.

This will require Exchange Online Powershell Module.
I recommend to install the latest Exchange Online Powershell Module that support Modern Authentication.

If you try to configure a Classification that is not defined in the “ClassificationList”

DataClassification provided is not supported. Valid values are “Internal,External,Confidential”.

Creating a new Office365 Group / Microsoft Teams

Now you will see a new option when creating Office365 Groups/Microsoft Teams and you can now select Classifications


Office365 Group for this Microsoft Team is classified as External.


Disclaimer: All scripts and references on this blog are offered “as is” with no warranty.  These scripts are tested in my environment, it is recommended that it is tested in a test environment before using in production.