Automate licensing and group membership for your Microsoft 365 Enterprise test environment
This Test Lab Guide can only be used for Microsoft 365 Enterprise test environments.
Group-based licensing automatically assigns or removes licenses for a user account based on group membership. Dynamic group membership adds or removes members to a group based on user account properties, such as Department or Country. This article steps you through a demonstration of both in your Microsoft 365 Enterprise test environment.
There are two phases to setting up auto-licensing and dynamic group membership in your Microsoft 365 Enterprise test environment:
- Create the Microsoft 365 Enterprise test environment.
- Configure and test dynamic group membership and automatic licensing.
Click here for a visual map to all the articles in the Microsoft 365 Enterprise Test Lab Guide stack.
Phase 1: Build out your Microsoft 365 Enterprise test environment
If you just want to test automated licensing and group membership in a lightweight way with the minimum requirements, follow the instructions in Lightweight base configuration.
If you want to test automated licensing and group membership in a simulated enterprise, follow the instructions in Pass-through authentication.
Testing automated licensing and group membership does not require the simulated enterprise test environment, which includes a simulated intranet connected to the Internet and directory synchronization for a Active Directory Domain Services (AD DS) forest. It is provided here as an option so that you can test automated licensing and group membership and experiment with it in an environment that represents a typical organization.
Phase 2: Configure and test dynamic group membership and automatic licensing
First, you create a new Sales group and add a dynamic group membership rule so that user accounts with the Department set to Sales are automatically added to the Sales group.
- Using a private instance of your Internet browser, sign in to the Office 365 portal at https://portal.office.com with the global administrator account of your Office 365 E5 test lab subscription.
- On a separate tab of your browser, go to the Azure portal at https://portal.azure.com.
- In the Azure portal, click Azure Active Directory > Users and groups > All groups.
- On the All groups blade, click New group.
- In Group type, select Office 365.
- In Group name, type Sales.
- In Membership type, select Dynamic user .
- Click Add dynamic query.
- In Add users where, select department.
- In the next field, select Equals.
- In the next field, type Sales.
- Click Add query, and then click Create.
- Close the Group and Groups-All groups blades.
Next, you configure the Sales group so that members are automatically assigned the Microsoft 365 E5 license.
- On the Overview blade for Azure Active Directory, click Licenses > All products.
- In the list, select Micrsooft 365 E5, and then click Assign.
- On the Assign license blade, click Users and groups.
- In the list of groups, select the Sales group.
- Click Select, and then click Assign.
- Close the Azure portal tab in your browser.
Next, you test dynamic group membership and automatic licensing on the User 4 account.
- From the Microsoft Office Home tab in your browser, click Admin.
- From the Microsoft 365 admin center tab, click Active users.
- On the Active users page, click the User 4 account.
- On the User 4 pane, click Edit for Product licenses.
- On the Product licenses pane, disable the Microsoft 365 E5 license, and then click Save > Close.
- In the properties of the User 4 account, verify that no product licenses have been assigned and there are no group memberships.
- Click Edit for Contact information.
- In the Edit Contact information pane, click Contact information.
- In the Department field, type Sales, and then click Save > Close.
- Wait a few minutes, and then periodically click the refresh icon in the upper-right of the User 4 account pane.
In time you should see the:
- Group memberships property updated with the Sales group.
- Product licenses property updated with the Microsoft 365 E5 license.
See these steps in the Identity phase for information and links to deploy dynamic group membership and automatic licensing in production:
Explore additional identity features and capabilities in your test environment.