PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Remove-ADPrincipalGroupMembership', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Removes a member from one or more Active Directory groups.


Remove-ADPrincipalGroupMembership [-Identity] <ADPrincipal> [-MemberOf] <ADGroup[]> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>]
[-PassThru] [-Server <String>] [-Confirm] [-WhatIf] [<CommonParameters>]

Search powershellhelp.space


The Remove-ADPrincipalGroupMembership cmdlet removes a user, group, computer, service account, or any other account object from one or more Active Directory groups.

The Identity parameter specifies the user, group, or computer to remove. You can identify the user, group, or computer by its distinguished name (DN), GUID, security
identifier (SID) or SAM account name. You can also specify a user, group, or computer object variable, such as $<localGroupObject>, or pass an object through the pipeline to
the Identity parameter. For example, you can use the Get-ADUsercmdlet to retrieve a user object and then pass the object through the pipeline to the
Remove-ADPrincipalGroupMembership cmdlet. Similarly, you can use Get-ADGroupor Get-ADComputerto get group, service account and computer objects to pass through the pipeline.

This cmdlet collects all of the user, computer, service account and group objects from the pipeline, and then removes these objects from the specified group by using one
Active Directory operation.

The MemberOf parameter specifies the groups that you want to remove the member from. You can identify a group by its distinguished name (DN), GUID, security identifier (SID)
or Security Accounts Manager (SAM) account name. You can also specify group object variable, such as $<localGroupObject>. To specify more than one group, use a
comma-separated list. You cannot pass group objects through the pipeline to the MemberOf parameter. To remove a member from groups that are passed through the pipeline, use
Remove-ADGroupMember cmdlet.



Online Version: http://go.microsoft.com/fwlink/p/?linkid=291092




-------------------------- EXAMPLE 1 --------------------------

PS C:\>Remove-ADPrincipalGroupMembership -Identity "Wilson Pais" -MemberOf "Administrators"
Remove members from group
Do you want to remove all the specified member(s) from the specified group(s)?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

This command removes the user Wilson Pais from the administrators group.

-------------------------- EXAMPLE 2 --------------------------

PS C:\>Get-ADUser -server localhost:60000 -Identity "CN=GlenJohns,DC=AppNC" | Remove-ADPrincipalGroupMembership -memberof "CN=AccessControl,DC=AppNC"

This command retrieves the user with DistinguishedName 'CN=GlenJohns,DC=AppNC' and remove it from the group with the DistinguishedName 'CN=AccessControl,DC=AppNC' using the