Forum Discussion
Bulk import (csv) external contacts to a specific distribution list (365)
Run the steps in the article to provision the contacts objects in your directory. Once that's done, you can add them all to a DG. Something like this should do:
Import-CSV blabla.csv | % { Add-DistributionGroupMember DG -Member $_.Emailaddress }
where the csv file is named blabla.csv and it contains a column "emailaddress" to designate the external contact.
- Bruno1400Oct 14, 2021Copper ContributorIt worked for me, thanks !
- CptNemoMay 24, 2020Copper Contributor
Thank you VasilMichev .
May I ask you two things considering the:
Import-CSV blabla.csv | % { Add-DistributionGroupMember DG -Member $_.Emailaddress }
1) Where should I write the distribution list name whereI want to add the emails ?
2) I guess before the blabla.csv I have to type the path, right?
Thank you again.- VasilMichevMay 24, 2020MVP
In the above, "DG" is the name of the group, you can also provide an email address. And yes, use the full path to the CSV file.
- Abdu655Sep 20, 2021Copper Contributor