First create the group.csv file as mentioned below
Username,groupname
User1,group1
User2,group2
User3,group3
#=========================================================================
import-csv "C:\temp\group.csv" | ForEach-Object {add-ADGroupMember -Identity $_.groupname -Members $_.username}
#=========================================================================
3 окт 2024