Share via


Group Membership Removal

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to remove all group memberships from a user.

Example

The following example demonstrates how to remove all group memberships from the user SaraDavis:

Get-ADPrincipalGroupMembership -Identity SaraDavis | % {Remove-ADPrincipalGroupMembership -Identity SaraDavis -MemberOf $_}

Additional information

For a full explanation of the parameters that you can pass to Get-ADPrincipalGroupMembership or Remove-ADPrincipalGroupMembership, at the Active Directory module command prompt, type Get-Help Get-ADPrincipalGroupMembership –detailed or Get-Help Remove-ADPrincipalGroupMembership –detailed, and then press ENTER.