Just like we added AD users in a group with the help of Ad-ADGroupMember PowerShell cmdlet, we can also remove AD users from a group using PowerShell.

Remove AD Members from Group Using PowerShell

1. Open PowerShell with elevated privileges.

2. Execute the following cmdlet if you would like to remove a single or multiple users (in this case WilsonPais, administrator) suppose from DocumentReaders group.

Remove-ADGroupMember -Identity "DocumentReaders" -Member "WilsonPais","administrator"

3. Execute the following piped cmdlet if you would like to remove multiple users in an OU (suppose Students) from DocuementReader group.

Get-ADUser -SearchBase ‘OU=Students,DC=yourdomain,DC=com’ -Filter * | ForEach-Object {Remove-ADGroupMember -Identity ‘DocumentReaders’ -Members $_ -Confirm:$false }

References

How to Remove AD Members from Group Using PowerShell

Leave a Reply

Your email address will not be published. Required fields are marked *

*