Add Members to Group from CSV

Occasional Visitor

Hello,

 

I'm looking for how to add members to groups from .csv files.

There is many exemples but none meet my needs.

 

test.csv

GroupsMembers
group1mail1 mail2
group2mail1 mail3
group3mail1 mail4
group4mail1 mail5
group5mail1 mail6

 

Thank you for your help

1 Reply
$m = import-csv -path memeber.csv foreach($i in $m){ Add-ADGroupMember -Identity "group name" -Members $m."what ever the member ext is"}