November 1st, 2013

PowerTip: Add User to Group in Active Directory with PowerShell

Doctor Scripto
Scripter

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”

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.