X

How to Remove AD Members from Group Using PowerShell

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

Karim Buzdar: About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various websites.
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings