PowerTip: Add User to Group in Active Directory with PowerShell

PowerTip: Add User to Group in Active Directory with PowerShell

  • Comments 4
  • Likes

Summary: Use Windows PowerShell to add a user to a security group in Active Directory.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add a user to a security group in Active Directory?

Hey, Scripting Guy! Answer In Windows Server 2012 R2 or Windows Server 2008 R2, use the Add-ADGroupMember cmdlet.

To add a user with a SAM ID “John.Smith” to a security group called “Finance”:

ADD-ADGroupMember “Finance” –members “John.Smith”

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • To add two or three members to group

    PS:>Add-ADGroupMember

    Identity: Finance

    Members[0]: ChendrayanVenkatesan

    Members[1]: ChenV

    Members[2]: PowerShell

  • What about if I want to add all members into one group ? or members in an OU into one group?

  • Hello,

    How would you acheive adding a user from domain A to a group that is in domain B via powershell without the Quest cmdlets? I've been trying to figure this out for about a week now. Please let me know if the scripting guy has seen this issue before.

    Thank you,

  • thanks