--- title: "Remove a User from a Microsoft 365 / Entra ID Group" slug: "dex-wf-remove-user-from-group" updated: 2026-11-30T16:16:10Z published: 2026-11-30T16:16:10Z canonical: "documentation.sysaid.com/dex-wf-remove-user-from-group" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.sysaid.com/llms.txt > Use this file to discover all available pages before exploring further. # Remove a User from a Microsoft 365 / Entra ID Group 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) 1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as a Groups Administrator, User Administrator, or Global Administrator. 2. Go to **Identity** > **Groups** > **All groups**. 3. In the search box, type the group name (`{group_name}`) and select the group from the results. 4. Under **Manage** > **Members**, use the search filter to find the user (`{user_upn}`). 5. Select the check box next to the user's name, then select **Remove** at the top of the list. 6. 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,groupTypes ``` Inspect 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,displayName ``` ### 3. Remove the member ``` DELETE https://graph.microsoft.com/v1.0/groups/{group-id}/members/{user-id}/$ref Authorization: Bearer ``` 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 lacks `GroupMember.ReadWrite.All`, or the group is protected by a role-assignable policy that requires Privileged Role Administrator. - `400 Bad Request` with *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 1. **Connect** to Graph and consent to the scope when prompted. 2. **Resolve** the group and user by their identifiers (UPN for the user, display name for the group). 3. **Safety-check** the group source. Stop if it is synced from on-premises AD or is a dynamic group. 4. **Call** `Remove-MgGroupMemberByRef` to perform the removal. 5. **Verify** by querying the membership again.