Powershell – Add Users to Security Group
Powershell to add users to groups with Get-ADGroup and Add-ADGroupMember cmdlets.
Add single user to security group:
Get-ADGroup -Identity "SomeGroup" | Add-ADGroupMember "some.user"
Add multiple users from a text file to security group, one user per line.
$list = Get-Content -Path "c:\tmp\list.txt" $group = Get-ADGroup "SomeGroup" ForEach ($user in $list) { Add-ADGroupMember $group $user }