Forum Discussion
sofo-83
Mar 30, 2022Copper Contributor
add just one user to many groups
Hi please help me to make a script in PowerShell to add just one user to many groups
Mar 30, 2022
sofo-83 You could use this one:
$Groups = @("group1","group2","..."groupN")
ForEach ($Group in $Groups) {Add-ADPrincipalGroupMembership <username> -MemberOf $Group}
(https://community.spiceworks.com/topic/2128061-powershell-adding-a-single-user-to-multiple-groups, more examples there)