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.
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.
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.
Microsoft says: Used for granting access to Microsoft 365 resources. Can contain users or devices. Supports dynamic membership. Not mail-enabled.
This is your main group type. This can be created as either assigned or dynamic. The ticket to this is determining the group structure ahead of time. I provide a breakdown in my GitHub that follows industry standards while putting a little Jhope finesse on top of things. To me this is the most important type. This is critical to RBAC, CA, privileged vs non-privileged. Typically these are the groups I'm using to enable PIM for Groups on, or allowing users to request via an access package, typically for authentication methods or CA exclusions. Getting these right sets the identity admin up for success in everything else.
groupTypes: []securityEnabled: truemailEnabled: false
Microsoft says: Used for collaboration between users, inside and outside your company. Members get group email, shared workspace, SharePoint, Planner, Stream, and calendar. Powers Microsoft Teams membership. Supports dynamic membership.
Unified groups are the backbone to SharePoint, Teams and OneDrive. For me this is easier said than done. These groups become an easy mechanism for group sprawl to occur. The trick is to limit this while not impeding progress. Typically I believe this should be controlled by a subset of accountable admins and team leads, then maintained via policy and access review and governance controls. I'll dig further into this in Section 6 on Protecting Groups.
groupTypes: ["Unified"]securityEnabled: truemailEnabled: true
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.
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.
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.
Microsoft says: A Security Group with dynamic user membership. Members are added and removed automatically when user attributes change. Rules evaluate against Entra user attributes like department, jobTitle, country, userType. Requires Entra P1 per user member.
Now this is where things get interesting. I use these extensively in controlling objects. Two caveats: don't use these for CA bypass and never add a dynamic expression for breakglass. This is a sure-fired way to let attackers bypass the security controls you put in place for a reason.
I have a ton of examples in my Groups Deep Dive in GitHub. License queries for CA to actively target all P1 or P2 users (if Microsoft auditors come knocking you'll be very glad you had that in place. I'm looking at you, 300 user practice with 1 P2 license), organizing on-premises objects like DUO users by setting an extension attribute via AD. Full dynamic membership rules reference on GitHub.
groupTypes: ["DynamicMembership"]securityEnabled: truemailEnabled: falsemembershipRule: user.department -eq "Sales"
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
Microsoft says: A Security Group with dynamic device membership. Rules evaluate against device attributes like deviceOSType, deviceOSVersion, deviceOwnership, deviceTrustType, enrollmentProfileName. No P1 license required for device members, though P1 is still required at the tenant level to use dynamic groups at all.
Important: you cannot mix users and devices in the same dynamic group. The rule builder UI only works for user rules. Device rules require the text box. Microsoft's own guidance says to use Intune assignment filters for pure Intune targeting and reserve dynamic device groups for cross-workload scenarios like Conditional Access, Autopilot profile assignment, or licensing.
Same as above, tons of examples in the repo. The big thing is not confusing Intune Filters vs Dynamic device groups. Use a dynamic device group when you need the same targeting to work across Intune AND Conditional Access, Autopilot, or licensing. Use a filter when the targeting is purely for Intune.
groupTypes: ["DynamicMembership"]securityEnabled: truemailEnabled: falsemembershipRule: device.deviceOSType -eq "Windows"
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.
| 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 supported | Creation only | ✗ | ✗ | ✗ |
| Nested Groups | ✓ (other SGs) | ✗ | ✗ Must be flat | MESGs only | ✓ (other DGs) |
| Soft-Delete Restore | Preview | 30 days GA | 30 days | ✗ | ✗ |
| Managed in Entra Portal | ✓ | ✓ | ✓ | Exchange only | Exchange only |
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.
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.
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.
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.
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.
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.
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."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.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.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
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.