Share via

adding multiple users to a cloud based distribution list

Anonymous
2019-06-13T14:15:13+00:00

Hi all,

I have spent hours trying to get such a simple thing to work.

I need to add multiple users to a newly created o365 distribution list. In the gui you can add only 1 user at a time so I went to the cloud az powershell and got as far as  this command

az ad group member add -g d5681480-71cc-4d6b-af62-6881243ee5dd --member-id <objectid>

but does it need an object id for every single user you want to add to the group,

Surely there is an easier way to add multiple users from a csv into a o365 normal distribution list.

Hair pulled out here.

Thanks if anyone has any advice.

Brian

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-06-14T09:54:42+00:00

It worked Mike,

Awesome.

So what I did was connect to o365 powershell and ran

##export existing members on onpremise dl##

Get-DistributionGroupMember -Identity dlname | select-Object Alias | export-csv c:\new.csv

###Import from 0365 shell alias list of members in o365 group##

import-csv C:\temp\new.csv | foreach {add-distributiongroupmember -identity dlname -member $_.alias}

Thanks for pointing me to the right way.

Brian

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-06-14T08:08:06+00:00

    Thanks very much Mike,

    I'll check that out.

    Cheers and have a good day.

    Brian

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-06-13T20:13:47+00:00

    Was this answer helpful?

    0 comments No comments