SIMULATION
Your company has an office in Seattle. You plan to create 100 users who will work in the Seattle office. All users will have their city attribute set to Seattle. You need to create a security group named Group1 that will automatically contain all the Seattle office users.
Create a dynamic user security group that evaluates the city attribute. Users will be added automatically whenever their city value equals Seattle.
Step-by-Step Solution with
Sign in to the Microsoft Entra admin center.
Navigate to:
Entra ID Groups All groups
Select New group.
Configure the basic group settings:
Setting
Value
Group type
Security
Group name
Group1
Microsoft Entra roles can be assigned to the group
No
Membership type
Dynamic User
Under Dynamic user members, select Add dynamic query.
In the rule builder, configure:
Rule component
Value
Property
city
Operator
Equals
Value
Seattle
Select Add expression if the portal requires the expression to be added to the rule.
Confirm that the complete rule syntax is:
(user.city -eq 'Seattle')
Select Save to save the dynamic membership rule.
Select Create to create Group1.
Open Group1 Dynamic membership rules and verify that the rule was saved correctly.
After the users are created with City = Seattle, allow Microsoft Entra time to evaluate their attributes and populate the group. Dynamic membership processing is not always immediate.
Do not manually add the 100 users. The dynamic rule ensures that new Seattle users are added and users whose city changes from Seattle are removed automatically. Microsoft lists city as a supported dynamic membership property with the syntax user.city -eq 'value'. Microsoft: Dynamic membership rules
Currently there are no comments in this discussion, be the first to comment!