conditionalaccess.tech Mastering Groups ← All Articles
Deep Dive Series

Mastering Groups

Groups are the connective tissue of identity and the shield that holds your security posture together. This is the deep dive: group types, nesting, enumeration risks, protections, portals, and the hygiene project behind it all.

Series8 Parts
AuthorJon Hope
Siteconditionalaccess.tech
01
Why Groups Are the Shield
On building identity security with intention, accountability, and a groups-first mindset.

Why do I feel so strongly about Groups. Some would say I almost rely on groups too heavily. In fact the only thing I don't use groups for is owners to Enterprise apps, but that's because it's not an option and there's a whole rabbit hole there to go down. I digress. Anyway. My love for groups can be summarized in two sayings. Groups are the shield of Identity and the connective tissue to identity and governance.

I've done a ton of posts in the past but my logic is this. Two or more identities should be managed via a group. That group should then have owners, humans accountable for the decisions on membership and permissions.

I found time and time again when doing IAM Projects, reviewing identities and grouping members based on roles, divisions, permissions. Always enabled me to simplify my approach to security. Whether it's an assigned group that holds highly privileged accounts or a dynamic group that automagically pulls in all my guest and disabled accounts. It allowed me to easily catalog and identify business units while helping to quickly sift through years of poor hygiene and security practices. All while applying ownership and accountability that was desperately needed.

"Two or more identities should be managed via a group. That group should have owners. Humans accountable for the decisions on membership and permissions."

While working through these initiatives at an MSP I found one thing that always held true. Not only were groups the connective tissue between M365 technologies like CA, Purview, Teams, SharePoint and Exchange. They were the bridge between on-premises and Entra. Case in point, a lot of our clients were in phase 2, stuck Hybrid and looking for Cloud First. Groups were central to that Cloud First journey.

What do I mean by this? Well let's break it down to the technology and simplify the logic. Typical clients would have outdated groups and OU structures that needed to be redefined for a cloud-first world. On-prem file shares that were not maintained. GPO targeting groups with no real logic, or logic that evolved over time while practices and SOPs didn't. What I would do is come in and start by building the foundation of what we were trying to achieve. I would build new groups for Cloud First initiatives like Conditional Access, Authentication Methods and SSO access. This was just the start. Then I would start migrating legacy workloads to the cloud. Think NTFS shares moving to Entra or Azure File Shares. This looked different depending on the org. This was a time to re-evaluate who had access and why. Think through how I would push these out through Intune.

This is the rationale behind the groups-first approach.

None of this is easy. If it were easy everyone would do it. The core of Groups and security is intentional control and accountability. If no one is accountable the system collapses and chaos follows. Sprawl, outdated membership and inevitably compromise.

02
Types, Behavior, and Connective Tissue
The six group types, what each one does, and where each one belongs in a security-first architecture.

Microsoft defines each of these extremely well but I'm gonna give you the down and dirty Jon Hope explanation of each as I see it. The Microsoft Learn comparison page is a great reference but let me break down what these actually mean in practice.

Distribution Groups
The Necessary Evil

Microsoft says: Used for sending email notifications to a set group of people. Static membership only. Members can be added to a Team, but the group itself is not. Only individual members join.

Well let's be honest, this is how we all get tickets. At the end of the day we need a single address that then annoys everyone in the organization, I mean alerts everyone in the organization! Fixed it! These are the necessary evil to ensuring the org runs smoothly and that everyone knows what's happening. Personally I would rather create a Teams channel with a Unified group and enable sending.

Mail-Enabled Security Groups
The Legacy Bridge

Microsoft says: Combines security group access control with email capability. Cannot be dynamically managed and cannot contain devices.

This feels and really is more legacy. A lot of the features can be replaced by either a Security group or an M365 group if you need the address. It does still provide a way to create a group that has the need for both security and email, but comes with significant limitations. In practice the MESG is best understood as a legacy hybrid object. If you need access control, use a Security Group. If you need email and collaboration, use an M365 Group. The only scenario where MESG still wins is when you genuinely need both in a single object with no interest in dynamic membership or device scope, which is a shrinking use case.

Dynamic Distribution Group
Pure Email Routing

Microsoft says: Defined and evaluated in Exchange Admin Center, not Entra. Membership is recalculated at send time against Exchange attributes. No static membership list exists. This is purely an email routing tool, not an access control object.

Gonna be honest, wasn't the email guy. Didn't use them a lot. Probably have created more in testing than in actual production.

Critical Security Note: Dynamic Groups and Attribute Write Permissions

The security of a dynamic group is only as strong as the write permissions on the attributes used in the rule. If users can modify their own department attribute, they can add themselves to the group. If that group controls CA exclusions or access to sensitive resources, you have a bypass vector. Source: Microsoft Learn, Dynamic membership rules

Dynamic M365 Group
Self-Managing Collaboration Workspaces

Microsoft says: A Microsoft 365 Group with dynamic user membership. Same collaboration features as a standard M365 Group but membership auto-populates from user attribute rules. M365 Groups can only contain users, never devices. Requires Entra P1 per user member.

Useful when you want a collaboration workspace that self-manages based on org attributes. For example, all users in a specific department automatically get the Teams workspace without manual onboarding.

Group Type Capability Matrix
Capability Security Group M365 Group Role-Assignable Mail-Enabled SG Distribution
Conditional Access✓✓✓✓✓
PIM Eligible✓✓✓ 1✗✗
License Assignment✓securityEnabled only✓✓✗
Device Members✓✗✗✗✗
Dynamic Membership✓ (users or devices)✓ (users only)✗ Blocked✗✗
HiddenMembership✗ Not supportedCreation only✗✗✗
Nested Groups✓ (other SGs)✗✗ Must be flatMESGs only✓ (other DGs)
Soft-Delete RestorePreview30 days GA30 days✗✗
Managed in Entra Portal✓✓✓Exchange onlyExchange only
1 Any security group or M365 group can be enabled for PIM for Groups. Role-assignable is not a requirement. Role-assignable groups are preferred for privileged access scenarios because they add write protection, but the PIM capability itself is available to all security and M365 groups. Source: Microsoft Learn, PIM for Groups
Group Naming Standardization

Consistent naming is the first thing that breaks down in most tenants. The image below covers the naming convention used across the scripts in the repo above.

Groups are the Connective Tissue — naming standardization across Entra, Intune, Governance, and Security
Groups as connective tissue: naming conventions across Entra, Intune, Governance, and Security. Standardize. Delegate. Scale.
Key Gotcha: M365 Group securityEnabled

Created in M365 Admin Center: securityEnabled: false, which means you cannot use it for licensing. Created in Entra Admin Center: securityEnabled: true, so licensing works. Created via Graph or PowerShell: you set it explicitly. The portal-specific behavior is widely observed but not explicitly documented by Microsoft. Verify in your own tenant before assuming.

Key Gotcha: isAssignableToRole is Immutable

The isAssignableToRole flag must be set at group creation. You cannot make an existing group role-assignable, and you cannot remove the flag once set. 500 group tenant limit. Plan ahead and get this right the first time.

03
Group Nesting
What works, what silently fails, and where inheritance breaks down across M365 workloads.

Group Nesting and Groups portal differences is where I spent a lot of time while studying for the SC-300. My hope is that this acts as a resource you can use for anyone going through the same questions and concerns when it comes to nesting. Now with that said, definitively there are two amazing articles on Groups from Ewelina that in my opinion are the gospel on group nesting limitations and configuration.

What I Tested Personally
Group testing in Entra portal showing distribution lists, M365 groups with and without security enabled, mail-enabled security groups, and HiddenMembership privacy column
Group testing in the conditionalaccess.tech tenant. Privacy column shows HiddenMembership on the M365 group created with that property. Type column shows how each group was classified by portal. Note the two M365 groups created in different portals with different securityEnabled defaults.
New in Graph: disableNesting Property

Big shout out to Daniel Bradley and msdocstracker.com/graph for pointing out the new Group Nesting property in Graph. This doesn't show by default but can be seen with the correct API permissions (Group.ReadWrite.All, then Group-NestingSupport.ReadWrite.All). You will then have to purposely expose the setting via the disableNesting property.

MS Docs Tracker showing the new disableNesting property update in Graph API
MS Docs Tracker surfacing the new disableNesting group property. Credit: Daniel Bradley at msdocstracker.com/graph

Did some quick testing below. Another great addition in securing groups down. As of right now this property is only available in the beta endpoint and has to be set via Graph. Worth noting the permission required is Group-NestingSupport.ReadWrite.All, not just Group.ReadWrite.All.

Creating a group with disableNesting set to true via Graph using Lokka
Verifying disableNesting: true on the group via Lokka. The beta endpoint is required: this property is not yet available in v1.0. Query uses $select=id,displayName,disableNesting,securityEnabled.
GET /v1.0/groups/{id}?$select=id,displayName,disableNesting
Graph query checking disableNesting property on a group
Graph Explorer confirming "disableNesting": true in the raw JSON response. Beta endpoint, explicit $select required: the property is hidden by default and won't appear in a standard GET.
Portal showing group nesting blocked when disableNesting is set to true
Portal behavior when disableNesting: true is enforced. Attempting to add Slytherin Dynamic User Group as a member of SG-Test-DisableGroupNesting returns "Failed to add group member: Unable to complete due to service connection error." The nesting is blocked at the API level, and the portal surfaces it as a failure.
Security Group→ into →Security GroupAllowed
Security Group→ into →M365 GroupBlocked
M365 Group→ into →Other Entra GroupsBlocked
Distribution Group→ into →Distribution GroupAllowed
Mail-Enabled SG→ into →Mail-Enabled SGAllowed
Security Group→ into →Mail-Enabled SGBlocked
Distribution Group→ into →Mail-Enabled SGBlocked
Any nested group→License assignmentNot supported: direct members only
Nested SG members→Conditional Access scopeEvaluated (transitive)
Nested SG members→SharePoint permissionsInherited (transitive)
Nested SG members→Teams channel accessInconsistent: verify per scenario
Nested SG members→M365 Group shared mailboxNot inherited
Any group→ into →Role-Assignable GroupBlocked: must be flat
Microsoft Learn: Add a group to another group, nesting limitations
Source: Microsoft Learn, How to manage groups
Membership Limits: Know Your Numbers

SharePoint Online: A user can be a direct or transitive member of up to 2,047 security groups before authentication and search results become unpredictable. This is documented in the Entra service limits page and cited directly in Microsoft Q&A against that source.

Conditional Access: A separate but related limit: if users or groups belong to more than 2,048 groups, CA policy evaluation may block access. Both limits apply to direct and nested membership combined. Source: Microsoft Learn, CA Users and Groups

04
Different Portals, Different Views

This section exists because of a study session. I was working through my SC-300 prep, following Ewelina's group type breakdown, and I started building test groups to validate what I was reading. Create an M365 group from the Admin Center. Create the same type from Entra. Compare.

They came back different. That was the thread that unravelled everything in this section.

Graph query showing M365 group securityEnabled difference between portals
Same group type. Different securityEnabled value. The portal you use at creation sets properties you might not expect.