question

JustinMicheal-7973 avatar image
0 Votes"
JustinMicheal-7973 asked KyleXu-MSFT answered

Add bulk users

We have a hybrid environment in which DL's created in On Premis . We need to add bulk of users to the particular DL.

Please provide us with the Command to add bulk(400-500) users to Distribution list

Need instructions with detailed commandlets please

office-exchange-online-itprooffice-exchange-server-mailflowoffice-exchange-server-connectivity
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered

@JustinMicheal-7973

First, you need to know that due to this group is created on Exchange on-premises, you can only add Exchange on-premises mailboxes into it, you cannot add Exchange online created mailboxes to it.

If you want to add multiple mailboxes into group in batch. You need to prepare a source file contains mailboxes that you want to add:
136084-qa-kyle-09-55-21.png

Then you will could use script below to add those mailboxes into the group that you wanted:

 $users = Import-Csv c:/temp/users.csv
    
 foreach ($user in $users){
     Add-DistributionGroupMember -Identity "Group" -Member $user.UserName
 }

Here are detailed information about it:
136095-qa-kyle-10-02-23.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.