Microsoft has announced that dynamic groups based on the MemberOf operator will no longer be supported. If your organization relies on group-based membership logic, you will need another way to keep those groups updated.
While discussing this internally, a colleague shared a PowerShell-based approach using Azure Automation. He gave me permission to share the idea, so I wanted to write it up here.
The idea is simple: instead of having Entra ID calculate the membership dynamically, an Azure Automation runbook does the sync on a schedule.
The runbook reads users from one or more source groups, compares the results with a target group, adds missing members, and removes users that no longer belong. The target group is therefore kept in sync automatically.
The setup is based on a simple mapping between source groups and target groups. One runbook can handle several sync scenarios, so you can scale it without making the solution harder than it needs to be.
I also like that it has a DryRun mode. Before enabling changes in production, the runbook can show exactly which users would be added or removed without changing any group memberships. That makes it much easier to test the setup before letting it make real changes.
The runbook also has safeguards to avoid accidental large-scale removals. For example, if a source group suddenly returns no members, it can stop instead of emptying the target group. Anyone who has troubleshot identity automation knows why that matters.
All actions are written to the Azure Automation job output, including:
- Users added
- Users removed
- Source groups involved in the synchronization
- Errors and warnings
- A final summary of the run
This makes it easy to see what happened during each run and much easier to troubleshoot if something looks wrong.
From an infrastructure side, the solution is fairly light. It uses Azure Automation, Managed Identity, and Microsoft Graph. Once it is configured, you can attach the runbook to a schedule and run it as often as you need.
Is this the only way to replace MemberOf-based dynamic groups? No. There are probably several other ways to solve it. But I liked this approach because it is practical, easy to understand, and uses services many organizations already have.
Leave a Reply