> For the complete documentation index, see [llms.txt](https://docs.intranet.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intranet.ai/sharepoint-intranet/other-configurations/creation-of-dynamic-groups-in-microsoft-entra-id.md).

# Creation of dynamic groups in Microsoft Entra ID

This guide covers the necessary steps to set up a **group with dynamic membership** in Microsoft Entra ID. This is particularly useful for the correct configuration of the [People Directory](https://docs.intranet.ai/sharepoint-intranet/configurations/people-directory), ensuring that it displays only employee contacts while excluding service accounts, admin contacts, and other users who should not be visible on the intranet.

Dynamic groups offer several benefits, the most important of which being **automated membership management**: dynamic groups automatically update their membership based on defined criteria, reducing the need for manual updates.

Please note that to create a dynamic group, an **admin account of Microsoft Entra** is needed.

{% hint style="info" %}
[Click here](https://learn.microsoft.com/en-us/entra/identity/users/groups-create-rule) to learn more about creating or updating a dynamic membership group in Microsoft Entra ID.
{% endhint %}

## Create a new group

To create a new group, take the following steps:&#x20;

* Go to the [**Microsoft Entra**](https://entra.microsoft.com/) portal.
* Select **Groups** in the left-hand navigation pane.
* Click on **All groups**.
* Choose **New group**.

<div align="left"><figure><img src="/files/mBQ3b6aQBkXu5YU6Qu4G" alt=""><figcaption></figcaption></figure></div>

* On the **Group** page, enter a name and a description for the new group.
* Select a **Membership type** for either users or devices.

***

## Create a dynamic query

* Select **Add dynamic query** to open the rule builder. The rule builder supports up to **five expressions**. To add more than five expressions, you must use the text box.
* In order to create a query that adds users according to a specific parameter (e.g. business email), use the text box and enter **-contains**.
* After creating the rule, select **Save**.
* Select **Create** to create the group.

***

## Create an associated Team

A Microsoft 365 group can be used to create a team in Microsoft Teams. The necessary steps are as follows:

* Go to the [admin exchange portal](https://admin.exchange.microsoft.com/).
* Click on **Groups** and select the newly created group.
* On the right-hand panel, click on **Microsoft Teams**.
* Select **Create a team**.

<div align="left"><figure><img src="/files/qxzrSd1OzXQRgo1SglJU" alt=""><figcaption></figcaption></figure></div>

Now you have a Microsoft 365 group with a dynamic membership and an associated team. You can also use it for [Teams push notifications](https://docs.intranet.ai/sharepoint-intranet/other-configurations/teams-push-notifications) in production.
