Revoke group membership cleanly across the admin center, Graph API, and PowerShell.
Complexity: Beginner. Impact: access-control + offboarding + group-management + least-privilege.
Why use this workflow
Group membership in Microsoft 365 and Entra ID drives access to shared mailboxes, Teams, SharePoint sites, licenses (through group-based licensing), and Conditional Access policy scope. When a user changes roles, leaves a team, or is offboarded from a specific business function, removing them from the appropriate group is a standard access-hygiene task.
This workflow covers removing a single user from a single group, the most common help desk request. It applies equally to security groups, Microsoft 365 groups, and mail-enabled security groups. It does not cover dynamic groups (membership there is rule-based and cannot be edited directly) or on-premises-synced groups (those must be edited in on-premises Active Directory).
Expected outcomes
- The specified user is no longer a member of the specified group.
- Any group-delivered access (shared resources, licenses assigned through the group, Conditional Access policy scope) is revoked on the next token refresh.
- An audit trail entry exists in the Entra audit log that shows who performed the removal and when.
Risks and considerations
Before you remove
- Confirm the group source. If the group is synced from on-premises AD (
onPremisesSyncEnabled = true), make the change in AD. Cloud-side removals are overwritten at the next sync cycle. - Dynamic groups cannot be edited manually. If the group has a membership rule, change the user's attributes (for example, department) so that they no longer match the rule.
- Group-based licensing. If the group assigns a license, removing the user may revoke that license. Confirm the user has alternate license coverage if they still need the service.
- Last owner rule. For Microsoft 365 groups, do not remove the only remaining owner without assigning a replacement. The group becomes unmanaged.
- Token latency. Access revocation is not instantaneous. Existing tokens remain valid until they expire. For urgent revocation (for example, a termination), also revoke the user's refresh tokens.
Required permissions
| Permission | Why it's needed |
|---|---|
| GroupMember.ReadWrite.All | Required to remove members from Entra ID groups through Microsoft Graph. |
| Group.ReadWrite.All | Alternative higher-scope permission that covers full group management. |
| Groups Administrator (role) | Least-privilege Entra role for admins who perform group membership changes in the portal. |
Ask Dex
Paste the prompt into a Dex conversation.
Prompt for IT admins
Remove {user} from the "{group_name}" group in Entra ID. Confirm the group is cloud-managed (not on-prem synced or dynamic), perform the removal, and verify the user no longer appears in the group's membership.
How an end user can ask Dex
I shouldn't have access to the {group_name} team anymore - can you take me off that list?
Manual steps (admin center)
- Sign in to the Microsoft Entra admin center as a Groups Administrator, User Administrator, or Global Administrator.
- Go to Identity > Groups > All groups.
- In the search box, type the group name (
{group_name}) and select the group from the results. - Under Manage > Members, use the search filter to find the user (
{user_upn}). - Select the check box next to the user's name, then select Remove at the top of the list.
- Confirm the prompt.
Verification
- Refresh the members list and confirm the user is no longer present.
- Go to Identity > Users > select the user > Groups and confirm the group no longer appears in their membership list.
- Review Identity > Monitoring & health > Audit logs. Filter by Activity: Remove member from group to see the audit entry.
If the Remove button is greyed out
The group is either dynamic (check the Membership type on the Overview page) or synced from on-premises AD (check Source). Neither can be edited from the cloud portal.
Microsoft Graph API
The Graph endpoint for removing a member is a DELETE against the member reference on the group.
1. Resolve the group ID (if you only have the display name)
GET https://graph.microsoft.com/v1.0/groups?$filter=displayName eq '{group_name}'&$select=id,displayName,onPremisesSyncEnabled,groupTypesInspect the response. If onPremisesSyncEnabled is true, stop and make the change in on-premises AD instead.
2. Resolve the user ID
GET https://graph.microsoft.com/v1.0/users/{user_upn}?$select=id,displayName3. Remove the member
DELETE https://graph.microsoft.com/v1.0/groups/{group-id}/members/{user-id}/$ref
Authorization: Bearer <access_token>A successful removal returns 204 No Content. Common error responses:
404 Not Found: the user is not a member of the group (an idempotent outcome that is safe to treat as success).403 Forbidden: the caller lacksGroupMember.ReadWrite.All, or the group is protected by a role-assignable policy that requires Privileged Role Administrator.400 Bad Requestwith Unable to update the specified properties for objects that have originated within an external service: the group is synced from on-premises AD.
4. Verify
GET https://graph.microsoft.com/v1.0/groups/{group-id}/members?$filter=id eq '{user-id}'An empty value array confirms removal.
PowerShell
Use the official Microsoft.Graph module, which is the supported successor to the deprecated AzureAD and MSOnline modules.
Prerequisites
- PowerShell 7 or later is recommended.
- Install the module:
Install-Module Microsoft.Graph -Scope CurrentUser - Connect with the required scope:
Connect-MgGraph -Scopes "GroupMember.ReadWrite.All"
Approach
- Connect to Graph and consent to the scope when prompted.
- Resolve the group and user by their identifiers (UPN for the user, display name for the group).
- Safety-check the group source. Stop if it is synced from on-premises AD or is a dynamic group.
- Call
Remove-MgGroupMemberByRefto perform the removal. - Verify by querying the membership again.