Azure AD Group Management (Microsoft Entra ID): A Step-by-Step Guide for Admins
Get-AzureADGroup or Get-MsolGroup must move to Microsoft Graph PowerShell. This guide uses the current names and shows the replacements.
Groups are how you stop managing access one person at a time. Done well, they control application access, licensing, device policy, Conditional Access and Azure permissions from a single place.
This guide teaches Azure AD (Microsoft Entra ID) group management from the ground up. You will learn the group and membership types, who can create and manage groups, how to create assigned and dynamic groups in the portal and with Microsoft Graph PowerShell, how to assign licenses and Azure roles to groups, how hybrid synced groups behave, and the governance and troubleshooting practices that keep a tenant clean as it grows.
⚡ Quick Summary
- Two group types: Security groups control access to resources. Microsoft 365 groups add collaboration (shared mailbox, Teams, SharePoint).
- Three membership types: Assigned (manual), Dynamic User and Dynamic Device (rule-based). Dynamic membership needs Microsoft Entra ID P1 for each unique user in a dynamic group.
- Privileged access: only role-assignable groups can hold Entra roles. They must be created that way, use Assigned membership and need P1 or P2.
- Automation: use Microsoft Graph PowerShell (
New-MgGroup,New-MgGroupMember) or the Azure CLI. The AzureAD and MSOnline modules no longer work. - Good hygiene: naming standards, at least two owners, dynamic rules on trusted attributes, expiration and access reviews for sprawl.
- Why groups matter
- Group types and membership types
- Who can create and manage groups
- Create a group in the Entra admin center
- Dynamic membership rules
- Manage members and owners
- Assign licenses to groups
- Use groups for apps, Azure roles and policies
- Role-assignable groups and PIM for Groups
- Manage groups with PowerShell and CLI
- Hybrid: groups synced from Active Directory
- Governance: naming, expiration and access reviews
- Troubleshooting
- Best practices checklist
- Cheat sheet
- FAQ
- Sources
Why groups matter
Every identity platform eventually hits the same scaling problem: individual assignments do not scale. Assigning an app, a license or a role to 500 people one by one is slow and error-prone, and nobody remembers to remove access later. Groups solve this by turning access into a membership question.
🔐 Access to apps
Assign enterprise applications to a group so new members get access automatically.
🪪 Licensing
Assign Microsoft 365 and other licenses to a group, and Entra ID adds or removes them as membership changes.
🛡️ Conditional Access
Target or exclude groups in policies, for example require MFA for a “Finance” group.
☁️ Azure RBAC
Assign Azure roles such as Reader or Contributor to groups at subscription, resource group or resource scope.
💻 Device and app policy
Target Intune policies and apps at user or device groups.
💬 Collaboration
Microsoft 365 groups back Teams, shared mailboxes, calendars and SharePoint sites.
Group types and membership types
Group types
| Group type | Purpose | Can contain | Notes |
|---|---|---|---|
| Security | Manage access to shared resources: apps, licenses, Azure roles, policies | Users, devices, service principals and other groups | The workhorse for access control. Can be nested in other security groups |
| Microsoft 365 | Collaboration: shared mailbox, calendar, SharePoint, Teams | Users (including guests, depending on tenant settings) | Has an email address. Cannot be nested in other groups |
Membership types
| Membership type | How members are added | Best for |
|---|---|---|
| Assigned | An owner or admin adds and removes members manually | Small teams, exceptions, privileged groups |
| Dynamic User | Rules on user attributes add and remove users automatically | Departments, locations, job titles, guests |
| Dynamic Device | Rules on device attributes add and remove devices | Intune targeting by OS or ownership |
Licensing and limits that matter for dynamic groups
- Dynamic membership requires a Microsoft Entra ID P1 license (or Intune for Education) for each unique user who is a member of one or more dynamic groups. Users do not need the license assigned to them to be members, but you must own enough licenses.
- No license is required for devices in device-based dynamic groups.
- A tenant can have a maximum of 15,000 dynamic membership groups.
- A rule can target users or devices, not both in the same group.
- A newer memberOf operator (listed as preview) lets a dynamic group build its membership from other groups. Only direct members of the source group are included.
Who can create and manage groups
| Role or person | What they can do |
|---|---|
| Global Administrator | Everything, including all group management |
| Groups Administrator | Create and manage groups and group settings, without broader user rights |
| User Administrator | Manage users and group membership for non-privileged groups |
| Group owner | Manage membership and settings of that specific group |
| Regular users | May be allowed to create security or Microsoft 365 groups, depending on your tenant’s group settings |
Owners versus members
Members receive the access the group grants. Owners manage the group but do not automatically get the access. Always assign at least two owners so a departing owner does not leave an orphaned group.
Create a group in the Entra admin center
Create an assigned security group
- Sign in to the Microsoft Entra admin center with Groups Administrator, User Administrator or higher.
- Go to Entra ID > Groups > All groups and select New group.
- Choose Group type: Security.
- Enter a Group name that follows your naming standard (for example
SG-Sales-Team) and a clear Description. - Leave Microsoft Entra roles can be assigned to the group set to No unless this is a privileged group (see the role-assignable section).
- Set Membership type: Assigned.
- Add at least two Owners, then add Members.
- Select Create.
Create a Microsoft 365 group
Choose Group type: Microsoft 365 instead. You then set a group email address, and the group can back a Team, shared mailbox or SharePoint site. Microsoft 365 groups also expose options such as guest access and, in some tenants, an expiration policy.
Dynamic membership rules
Dynamic groups remove manual membership work. You write a rule, and Entra ID evaluates users or devices against it and adds or removes them automatically.
- Create a new group and set Membership type to Dynamic User (or Dynamic Device).
- Select Add dynamic query.
- Build the rule with the rule builder, or use the Rule syntax editor for advanced expressions.
- Use Validate Rules (Preview) to test the rule against sample users or devices before saving.
- Save and create the group, then check the membership after processing completes.
Rule syntax examples
# All members of the Sales department
(user.department -eq "Sales")
# Enabled, internal (non-guest) employees in Pakistan
(user.accountEnabled -eq true) and (user.userType -eq "Member") and (user.country -eq "PK")
# Managers (job title contains "Manager")
(user.jobTitle -contains "Manager")
# All guest users
(user.userType -eq "Guest")
# Users whose UPN starts with "svc-" are excluded from a general group
(user.userPrincipalName -notStartsWith "svc-")
# Corporate-owned Windows devices (Dynamic Device group)
(device.deviceOSType -eq "Windows") and (device.deviceOwnership -eq "Company")
-eq, -ne, -startsWith, -notStartsWith, -contains, -notContains, -match, -in and -notIn, combined with -and, -or and -not. Always wrap each condition in parentheses.Dynamic group tips
- Rules are not instant. Membership updates after processing, which can take time, especially for large tenants. Do not expect immediate changes.
- Clean data is the foundation. Empty or inconsistent attributes (department, country, job title) produce wrong membership. Fix the source in HR or Active Directory.
- Start with a validation group and review members before attaching licenses or access.
- Keep rules simple and documented in the group description.
Manage members and owners
In the portal
- Open Entra ID > Groups > All groups and select the group.
- Choose Members or Owners, then Add or Remove.
- For many users at once, use Bulk operations (add or remove members, or download the member list) with the provided CSV template.
Nesting groups
A security group can contain other security groups, which lets you build structures such as “All Engineering” containing “Dev” and “QA”. Use nesting carefully:
- Microsoft 365 groups cannot be nested in other groups.
- Role-assignable groups cannot have other groups as active members.
- Group-based licensing applies to direct members, not members of nested groups.
- Deep nesting makes access hard to audit. Keep it to one or two levels.
Assign licenses to groups
Group-based licensing is one of the best uses of groups, because it ties licenses to membership. When someone joins the group, the license is assigned. When they leave, it is removed. It requires Microsoft Entra ID P1.
- Open the group in the Entra admin center and select Licenses.
- Choose Assignments, then select the products and the service plans to enable.
- Save. Entra ID processes the assignment for all current members.
- Check the group’s Licenses page for any members showing errors.
Use groups for apps, Azure roles and policies
Enterprise applications
In Entra ID > Enterprise apps > your app > Users and groups, assign a group instead of individual users. Combine this with a dynamic group and access follows the user’s attributes. Assigning access to apps through groups requires Microsoft Entra ID P1 or P2.
Azure RBAC
Assign Azure roles to groups rather than individuals, so access reviews and offboarding stay simple.
# Give a group Reader access on a resource group
az role assignment create \
--assignee-object-id <group-object-id> \
--assignee-principal-type Group \
--role "Reader" \
--scope /subscriptions/<subscription-id>/resourceGroups/rg-prod
Conditional Access and Intune
- Conditional Access: include or exclude groups in policy assignments. Keep an emergency “break-glass” exclusion group and monitor it closely.
- Intune: target configuration profiles, compliance policies and app deployments at user or device groups.
Role-assignable groups and PIM for Groups
If you want to give a group a Microsoft Entra directory role such as Helpdesk Administrator, the group must be a role-assignable group. These carry extra protections because assigning a role to a group is a powerful action.
| Rule for role-assignable groups | What it means |
|---|---|
| Set at creation only | You cannot convert an existing group. Create a new one with the “Microsoft Entra roles can be assigned to the group” option |
| Who can create | At least the Privileged Role Administrator role |
| Membership type | Must be Assigned. Dynamic membership is not allowed |
| Who can manage membership | Global Administrator, Privileged Role Administrator or the group owner |
| Nesting | A group cannot be an active member of a role-assignable group |
| Licensing | Microsoft Entra ID P1 or P2 |
| Graph permission | RoleManagement.ReadWrite.Directory to manage membership through Microsoft Graph |
| Per-tenant limit | Reported as 500 role-assignable groups per tenant. Confirm the current limit in Microsoft’s documentation |
Privileged Identity Management (PIM) for Groups adds just-in-time membership or ownership to a group, so members are eligible and must activate for a limited time. It is separate from role-assignable groups: a group can be one without the other, though Microsoft recommends role-assignable groups for sensitive access. PIM for Groups requires Microsoft Entra ID P2 or an Entra ID Governance license.
Manage groups with PowerShell and CLI
Old cmdlets and their replacements
| Task | Old (retired) | Microsoft Graph PowerShell |
|---|---|---|
| Get groups | Get-AzureADGroup, Get-MsolGroup | Get-MgGroup |
| Create a group | New-AzureADGroup | New-MgGroup |
| List members | Get-AzureADGroupMember | Get-MgGroupMember |
| Add a member | Add-AzureADGroupMember | New-MgGroupMember |
| Remove a member | Remove-AzureADGroupMember | Remove-MgGroupMemberByRef |
| List owners | Get-AzureADGroupOwner | Get-MgGroupOwner |
| Add an owner | Add-AzureADGroupOwner | New-MgGroupOwnerByRef |
| Delete a group | Remove-AzureADGroup | Remove-MgGroup |
Connect and create groups
# Install once (or install only the sub-modules you need)
Install-Module Microsoft.Graph -Scope CurrentUser
# Connect with least-privilege scopes
Connect-MgGraph -Scopes "Group.ReadWrite.All","GroupMember.ReadWrite.All","User.Read.All"
# Create an assigned security group
$group = New-MgGroup -DisplayName "SG-Sales-Team" `
-Description "Sales team access group" `
-MailEnabled:$false -MailNickname "sg-sales-team" `
-SecurityEnabled:$true
# Create a Microsoft 365 group
New-MgGroup -DisplayName "M365-Project-Atlas" `
-MailEnabled:$true -MailNickname "project-atlas" `
-SecurityEnabled:$false -GroupTypes @("Unified")
# Create a dynamic security group (rule requires Entra ID P1)
New-MgGroup -DisplayName "DG-Sales-Users" `
-MailEnabled:$false -MailNickname "dg-sales-users" -SecurityEnabled:$true `
-GroupTypes @("DynamicMembership") `
-MembershipRule '(user.department -eq "Sales")' `
-MembershipRuleProcessingState "On"
Manage members and owners
# Find a group
$group = Get-MgGroup -Filter "displayName eq 'SG-Sales-Team'"
# Add a member
$user = Get-MgUser -UserId "alice@contoso.com"
New-MgGroupMember -GroupId $group.Id -DirectoryObjectId $user.Id
# Remove a member
Remove-MgGroupMemberByRef -GroupId $group.Id -DirectoryObjectId $user.Id
# List members (UPN column)
Get-MgGroupMember -GroupId $group.Id -All |
ForEach-Object { $_.AdditionalProperties.userPrincipalName }
# Add an owner
New-MgGroupOwnerByRef -GroupId $group.Id -BodyParameter @{
"@odata.id" = "https://graph.microsoft.com/v1.0/users/$($user.Id)"
}
# Groups a user belongs to
Get-MgUserMemberOf -UserId $user.Id -All |
ForEach-Object { $_.AdditionalProperties.displayName }
# Change a dynamic rule
Update-MgGroup -GroupId $group.Id -MembershipRule '(user.department -eq "Sales") -and (user.accountEnabled -eq $true)'
# Delete a group
Remove-MgGroup -GroupId $group.Id
Add many users from a CSV
# users.csv has a column named UserPrincipalName
$group = Get-MgGroup -Filter "displayName eq 'SG-Sales-Team'"
Import-Csv .\users.csv | ForEach-Object {
try {
$u = Get-MgUser -UserId $_.UserPrincipalName -ErrorAction Stop
New-MgGroupMember -GroupId $group.Id -DirectoryObjectId $u.Id -ErrorAction Stop
Write-Host "Added $($_.UserPrincipalName)"
} catch {
Write-Warning "Failed: $($_.UserPrincipalName) - $($_.Exception.Message)"
}
}
Azure CLI alternative
az ad group create --display-name "SG-Sales-Team" --mail-nickname "sg-sales-team"
az ad group member add --group "SG-Sales-Team" --member-id <user-object-id>
az ad group member list --group "SG-Sales-Team" --query "[].userPrincipalName" -o tsv
az ad group delete --group "SG-Sales-Team"
RoleManagement.ReadWrite.Directory permission.Hybrid: groups synced from Active Directory
Many tenants synchronize on-premises Active Directory groups to Microsoft Entra ID with Microsoft Entra Connect or Cloud Sync. Two rules prevent most confusion:
- The on-premises directory is the source of authority for synced groups. You manage membership in Active Directory, and changes sync to the cloud. You cannot change the membership of a synced group in the Entra admin center.
- Cloud-only groups are managed in the cloud. Use these for cloud-specific access such as Microsoft 365 licensing, Conditional Access or Azure RBAC, so you are not waiting on a sync cycle.
Governance: naming, expiration and access reviews
Groups multiply quickly. Without governance you end up with thousands of unowned, undocumented groups.
| Control | What it does | Typical license |
|---|---|---|
| Naming policy | Enforces prefixes or suffixes and blocks reserved words for Microsoft 365 groups | Entra ID P1 |
| Expiration policy | Expires inactive Microsoft 365 groups and asks owners to renew them | Entra ID P1 |
| Access reviews | Periodically asks owners or managers to confirm who should stay in a group | Entra ID P2 or ID Governance |
| Entitlement management | Packages groups, apps and sites with request and approval workflows | ID Governance |
| Self-service group management | Lets users request to join security groups or create groups under policy | Entra ID P1 |
Audit group changes
In Entra ID > Monitoring & health > Audit logs, filter by category GroupManagement to see who added or removed members, changed owners or edited a dynamic rule. Send audit logs to Log Analytics or your SIEM and alert on changes to privileged groups.
Troubleshooting
| Problem | Likely cause and fix |
|---|---|
| Dynamic group is empty or wrong | Check rule syntax with Validate Rules, confirm the attribute is populated on the user, and confirm processing is On. Allow time for processing. |
| Cannot add or remove members | The group may be synced from Active Directory, role-assignable (restricted managers), or you lack permission. Check the group source and your role. |
| Cannot make an existing group role-assignable | This is set only at creation. Create a new role-assignable group and migrate. |
| License not applied through the group | Check usage location, available licenses, service plan conflicts and whether the user is a direct member rather than in a nested group. |
| “Insufficient privileges” in PowerShell | Reconnect with the right scopes, for example Group.ReadWrite.All, and make sure an admin has consented. |
Get-AzureADGroup or Get-MsolGroup fails | Those modules are retired. Migrate the script to Microsoft Graph PowerShell. |
| Users cannot create groups | Group creation is restricted in the group settings. Adjust the setting or ask an admin or owner. |
| Security group does not appear in Exchange mail flow | Security groups are not mail-enabled. Use a Microsoft 365 group or a mail-enabled security group managed in Exchange. |
| Member added but access not working yet | Tokens and caches take time to refresh. Have the user sign out and in, and check whether the resource syncs group membership on a schedule. |
| Group deleted by mistake | Deleted Microsoft 365 groups can be restored for a limited period from Deleted groups. Check the retention window for your tenant. |
Best practices checklist
- Assign access to groups, never to individuals, wherever the service allows it.
- Use a naming convention that shows purpose and type, for example
SG-App-Salesforce-Users,DG-Dept-Finance,M365-Project-Atlas. - Give every group at least two owners and a description.
- Prefer dynamic groups for attribute-driven membership, but only when the attributes are reliable and not user-editable.
- Use role-assignable groups and PIM for anything that grants privileged roles, and keep membership small.
- Limit who can create groups, and apply naming and expiration policies to Microsoft 365 groups.
- Keep nesting shallow and remember licensing does not follow nested membership.
- Run access reviews on groups that grant sensitive access, and on groups with guests.
- Automate with Microsoft Graph PowerShell and keep scripts in source control with least-privilege scopes.
- Log and alert on membership changes for privileged groups and on dynamic rule edits.
- Clean up regularly: remove empty, ownerless and unused groups.
Cheat sheet
| Task | Where or command |
|---|---|
| Open group management | Entra admin center > Entra ID > Groups > All groups |
| Create a security group | New-MgGroup -DisplayName "SG-X" -MailEnabled:$false -MailNickname "sg-x" -SecurityEnabled:$true |
| Create a Microsoft 365 group | New-MgGroup ... -GroupTypes @("Unified") -MailEnabled:$true |
| Create a dynamic group | New-MgGroup ... -GroupTypes @("DynamicMembership") -MembershipRule '(...)' |
| Add a member | New-MgGroupMember -GroupId $id -DirectoryObjectId $userId |
| Remove a member | Remove-MgGroupMemberByRef -GroupId $id -DirectoryObjectId $userId |
| List members | Get-MgGroupMember -GroupId $id -All |
| Find a user’s groups | Get-MgUserMemberOf -UserId $userId -All |
| Assign a license to a group | Group > Licenses > Assignments (needs P1) |
| Give a group an Azure role | az role assignment create --assignee-object-id <id> --assignee-principal-type Group --role Reader --scope ... |
| Review group changes | Audit logs > category GroupManagement |
If you manage Active Directory, Azure and Microsoft 365 together, more practical identity and hybrid guides are on VMoreCloud.
Frequently asked questions
Is Azure AD the same as Microsoft Entra ID?
Yes. Microsoft renamed Azure Active Directory to Microsoft Entra ID in 2023. The features are the same product family, and many tutorials and older portals still use the Azure AD name.
What is the difference between a security group and a Microsoft 365 group?
A security group controls access to resources such as apps, licenses and Azure roles. A Microsoft 365 group adds collaboration features such as a shared mailbox, calendar, SharePoint site and Teams, and has an email address.
Do dynamic groups need a license?
Yes. Dynamic membership requires Microsoft Entra ID P1 (or Intune for Education) for each unique user who is a member of one or more dynamic groups. Devices in device-based dynamic groups do not need a license.
Can I assign an Entra role to any group?
No. Only role-assignable groups can receive Entra directory roles. They must be created as role-assignable, use Assigned membership and need Microsoft Entra ID P1 or P2.
Which PowerShell module should I use for Entra ID groups?
Use the Microsoft Graph PowerShell SDK, for example New-MgGroup and Get-MgGroupMember. The AzureAD and MSOnline modules are retired.
Why can I not edit a group’s members in the portal?
It is often a group synced from on-premises Active Directory, where membership is managed on-premises, or a role-assignable group with restricted managers. Check the group’s source and your role.
Sources and further reading
- Microsoft Learn: Learn about group types, membership types and access management
- Microsoft Learn: Manage rules for dynamic membership groups in Microsoft Entra ID
- Microsoft Learn: Use Microsoft Entra groups to manage role assignments
- Microsoft Learn: Privileged Identity Management for Groups
- Microsoft Learn: Dynamic groups with the memberOf operator (preview)
- Microsoft Learn: Manage Microsoft Entra groups and group membership
- Microsoft Learn: Assign licenses to a group
- Microsoft Learn: Microsoft Graph PowerShell overview
- Microsoft Entra Blog: AzureAD PowerShell retirement
- GitHub: AzureAD to Microsoft Graph migration resources
This guide is based on Microsoft documentation and announcements available on October 28, 2026. Licensing requirements, limits and preview features change often, so confirm details in the Microsoft documentation and your own tenant before making changes. Test group, licensing and role changes in a non-production tenant first.

