Adding and Removing Members of a Group
This topic explains how to use the Active Directory module for Windows PowerShell to add or remove members of a group.
Example 1
The following example demonstrates how to add the user SaraDavis to the group SvcAccPSOGroup:
Add-ADGroupMember -Identity SvcAccPSOGroup -Member SaraDavis
Add-ADGroupMember -Identity SvcAccPSOGroup -Member SaraDavis
Example 2
The following example demonstrates how to remove the user SaraDavis from the group SvcAccPSOGroup:
Remove-ADGroupMember -Identity SvcAccPSOGroup -Member SaraDavis
Remove-ADGroupMember -Identity SvcAccPSOGroup -Member SaraDavis
Additional information
For a full explanation of the parameters that you can pass to Add-ADGroupMember or Remove-ADGroupMember, at the Active Directory module command prompt, type Get-Help Add-ADGroupMember –detailed or Get-Help Remove-ADGroupMember –detailed, and then press ENTER.
No comments:
Post a Comment