This sounds quite complicated, but in reality it simply means letting Azure Active Directory (AAD) handle group membership based on attributes like department or role.
If you set this up then when people join, move, or leave they will automatically be added to or removed from security groups. If you're using security groups in SharePoint, this will lower your maintenance burden considerably. It also allows you to set up a permissions strategy that doesn't require everyone who deals with user accounts to know the ins and outs of what permissions any given user requires. Dynamic security group membership is a "set it and forget it" system where AAD will handle putting people in whichever security groups are appropriate based on their user profile attributes.
This doesn't mean it doesn't need management, as you'll need to add the dynamic membership requirements to new groups, and change the requirements for existing groups if/when your organisation's structure changes. But, after you've set it up for the existing groups, that's all you'll have to do in the future.
Here's how to add dynamic membership to a group.
- Open AAD and find your security group:
- Click on the group to select it. The menu on the left hand side will display the options for that specific group. Click Properties:
- The Membership type of your group will be displayed:
- Change the Membership type from "Assigned" to "Dynamic User". A confirmation dialogue will pop up; click Yes on this:
WARNING: Doing this will remove existing users from your group.
- Click the new Add dynamic query option that has appeared at the bottom of the Properties panel, and create your rule from the dropdowns:
- Click Add query at the bottom of the panel to add the query to your group. AAD will then populate the group membership with all users who match your query.
Microsoft have provided a thorough overview of the syntax and valid terms for advanced queries which I encourage you to work through. It might appear intimidating initially (especially if you're not used to command line or PowerShell scripting) but it's really quite simple once you understand the logic. Being able to write multi-part queries will significantly increase your options for dynamic membership, especially if you have situations where some, but not all, members of a team need to be in a group.
Once you've added the appropriate membership rule to a group, you've finished. Your group now has a dynamic membership that will change automatically based on user attributes.
Between SharePoint groups, security groups, and dynamic group membership, you've got all the tools you need to make sure that the right users have the right access to the right SharePoint areas, all done automatically based on their user attributes. However, knowing how to do this is just the technical side of permissions. You also need to understand who should have access to what, and why. This is the function of a permissions strategy, which we'll look at next.