need assistance creating and populating multiple distribution groups in office 365

can someone provide a powershell script that we can use to create 100+ distribution groups in our cloud based office 365 account [not hybrid] and populate membership.

our input file is:
column a                column b
usera                       group1
userb                       group1
userc                        group 1
usera                       group2
userb                       group2
userc                       group2

many thanks,

Who is Participating?
SubsunConnect With a Mentor Commented:
Add-DistributionGroupMember should work for exchange online as well...
Import-csv C:\user.csv | % {Add-DistributionGroupMember $_.Group -Member $_.Member}

Open in new window

Input csv format..

Open in new window

siber1Author Commented:
thx Subsun. I will test that with our exchange online account shortly.
siber1Author Commented:
thanks Subsun. worked great!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.