How to remove users from an Active Directory group using PowerShell

Last updated on:

Removing a user from an Active Directory (AD) group is a common AD management task when someone changes roles, leaves a project, or is offboarded. Because group membership is what grants access to shared folders, applications, and mailboxes, taking a user out of the right group is often how you revoke that access cleanly, without touching the account itself.

There are three practical ways to do it: with the Remove-ADGroupMember cmdlet in PowerShell, the Active Directory Users and Computers (ADUC) console, and ManageEngine ADManager Plus. This guide covers all three, including how to verify the change and common errors to expect.

Prerequisites

Before you proceed, make sure the following are in place:

  • Permissions: Your account must have rights to modify the group's membership, which membership in Account Operators or Domain Admins provides, or delegated write access to the target group.
  • Tools: For the GUI method, you need ADUC, part of the Remote Server Administration Tools (RSAT) on Windows 10 and 11 and present by default on domain controllers (DCs). For scripting, you need the ActiveDirectory PowerShell module, which is also delivered with RSAT.
  • PowerShell
  • ADUC
  • ADManager Plus
  • Limitations
  • Why ADManager Plus
  • FAQs
 

How to remove a user from a group using PowerShell

Before removal, it is good practice to see who is in a group before changing it, both to confirm the user is actually a member and to keep a record of the membership. Get-ADGroupMember lists the direct members of a group.

Using the Remove-ADGroupMember cmdlet

The Remove-ADGroupMember cmdlet takes the group in -Identity and the user in -Members, identified by sAMAccountName, distinguished name (DN), security identifier (SID), or globally unique identifier (GUID):

Remove-ADGroupMember -Identity "Sales Team" -Members "jsmith"

By default, the cmdlet asks for confirmation before removing the member, since it is a change to access. Enter Y to proceed, or use the -Confirm:$false flag below to skip the prompt in a script:

Remove-ADGroupMember -Identity "Sales Team" -Members "jsmith" -Confirm:$false

Use -Confirm:$false deliberately, since it removes the safety check. It is appropriate in a tested script, but for a one-time manual removal, leaving the prompt in place is a useful guard against a mistyped name.

Bulk removing users from an Active Directory group

To remove several users at once, pass a comma-separated list to -Members, or drive the removal from a CSV for a larger set. Here's an example of removing a few named users in one command:

Remove-ADGroupMember -Identity "Sales Team" -Members "jsmith","mday","apatel" -Confirm:$false

For a longer list, prepare a CSV with a sAMAccountName column and loop through it, wrapping the call in error handling so one bad row doesn't stop the run:

Import-Csv "C:\Imports\remove-list.csv" | ForEach-Object {
try {
Remove-ADGroupMember -Identity "Sales Team" -Members $_.sAMAccountName -Confirm:$false -ErrorAction Stop
Write-Host "Removed: $($_.sAMAccountName)"
} catch {
Write-Warning "Failed: $($_.sAMAccountName) - $($_.Exception.Message)"
}
}

To remove one user from every group they belong to—a common offboarding step—get the user's group memberships and loop the removal over each. The where clause keeps the user's primary group (usually Domain Users), which can't be removed this way:

$user = "jsmith"
Get-ADPrincipalGroupMembership -Identity $user |
Where-Object { $_.Name -ne "Domain Users" } |
ForEach-Object {
Remove-ADGroupMember -Identity $_ -Members $user -Confirm:$false
}

Supported parameters and cmdlets

The parameters and cmdlets below are used for removing users from AD groups in PowerShell.

Parameter Description
Remove-ADGroupMember Removes one or more members from an AD group.
-Identity The group to remove members from, by name, sAMAccountName, DN, SID, or GUID.
-Members The user(s) to remove, as a single value or a comma-separated list.
-Confirm:$false Suppresses the confirmation prompt for unattended scripts.
Get-ADGroupMember Lists a group's members; -Recursive expands nested groups.
Get-ADPrincipalGroupMembership Lists the groups a user belongs to, used for verification or removing from all groups.
Export-Csv Exports the membership list to a CSV file for a record.

Troubleshooting common errors

  • Cannot find an object with identity: The -Identity group or a -Members user doesn't match an existing object. Confirm the exact sAMAccountName or name; Get-ADGroupMember and Get-ADUser help you check.
  • Access is denied: The account lacks rights to modify the group. Use an account in Account Operators or Domain Admins, or one with delegated write access to the group, then retry.
  • The user isn't a direct member: If a removal reports the user isn't in the group, they may be a member through a nested group. Use Get-ADGroupMember -Recursive to find the nested group and remove them from that group instead.
  • The script stalls waiting for input: The confirmation prompt is blocking an unattended run. Add -Confirm:$false to the command.
  • The change isn't visible yet: In a multi-DC environment, the removal may not have replicated to the DC you're querying. Allow replication to converge, or force it, then verify again.

How to remove a user from a group using ADUC

For a single removal through the GUI, ADUC handles it from either the user or the group object:

  1. Open Active Directory Users and Computers by running dsa.msc.
  2. Right-click the user, click Properties, and open the Member Of tab (or open the group's Properties and the Members tab).
  3. Select the group to remove the user from, and click Remove.
  4. Click Apply, then OK. The membership change takes effect immediately.

How to remove a user from a group using ADManager Plus

ADManager Plus is a unified AD, Microsoft Exchange, and Microsoft 365 management and reporting tool that removes users from groups through a point-and-click console, for one user or thousands, with no scripting.

  1. Log in to ADManager Plus and navigate to the Management tab > User Management > Bulk User Modification > Group Attributes.
  2. In the Remove from group field, select the group(s) you want to remove users from.
  3. Select the domain and enter the names of the users you want to remove. To remove users in bulk, click CSV Import and upload a CSV file containing the user list.
  4. On the next screen, verify the user list and click Apply.
Removing users in bulk from an AD group using ADManager Plus.

Automating user removal

ADManager Plus also enables you to remove users automatically on a schedule or triggered by an event such as a disabled account. Feeding the automation from an inactive or disabled users report keeps stale access from lingering.

  1. Navigate to the Automation tab and click + Create New Automation.
  2. Enter the automation name and description, select User Automation as the category, and select your domain.
  3. Under Tasks to automate, select Remove from Group.
  4. Under Select objects, choose the Inactive Users report and set the inactivity period (for example, 60 days).
  5. Set the execution time, then click Save.
Configuring an automation to remove users from an AD group using ADManager Plus.

Orchestrate group removal as part of offboarding

ADManager Plus orchestration chains group removal into a wider joiner-mover-leaver sequence, so it runs as one step among many when a user changes role or leaves, rather than as an isolated task.

How to verify that users have been successfully removed

After a removal, list the group's members again using Get-ADGroupMember and confirm that the specified user no longer appears. To verify from the user's side, run:

Get-ADPrincipalGroupMembership -Identity "jsmith"

This lists the groups the user still belongs to, so you can confirm the target group no longer appears. For a script-free approach, run ADManager Plus' group reports.

Limitations of using native tools

ADUC and PowerShell remove group members reliably, but each has limits that show at scale:

  • No built-in removal workflows: Group membership removals must be performed manually. ADUC cannot automate them based on a schedule or predefined conditions.
  • PowerShell needs complex scripting: Removing users at scale or from all their groups requires writing and testing a script with its own error handling.
  • No built-in approval or audit trail: Neither native tool has an approval step before a bulk removal, or a built-in record of who removed whom, which auditors often ask for.
  • Delegation is coarse: Letting help desk staff remove members safely, scoped to certain groups or OUs, means delegating directory rights carefully or building wrapper scripts.

Streamline group management with ADManager Plus

ADManager Plus replaces scripts and one-off console edits with a single console for AD, Microsoft 365, and Exchange management and reporting:

FAQ

To remove multiple users from a group, pass a comma-separated list to -Members, or loop a CSV through the following command in PowerShell:

Import-Csv "C:\Imports\remove-list.csv" | ForEach-Object {
Remove-ADGroupMember -Identity "Sales Team" -Members $_.sAMAccountName -Confirm:$false
}

For a script-free approach, ADManager Plus offers CSV-based bulk removal through its GUI.

Add -Confirm:$false to the command. By default, the cmdlet prompts before removing a member, which stalls an unattended script; the flag suppresses the prompt. Use it only in a tested script, since it removes the safety check.

The one-stop solution to Active Directory Management and Reporting
Email Download Link Email the ADManager Plus download link