question

RogerRoger-2394 avatar image
0 Votes"
RogerRoger-2394 asked KaelYao-MSFT commented

Distribution Lists

Hi All

i have two requirements.

i have a csv file with DL lists in the below format. i have two users user1@contoso.com and user2@contoso.com i want to remove existing DL owners by importing the csv file and make user1 and user2 as DL owners. For any DL in the csv file, if there are no owners defined then user1 and user2 should be made DL owners.

dls
dl1@contoso.com
dl2@contoso.com

i have a csv file with DL lists in the below format. i have two users user1@contoso.com and user2@contoso.com i want to make user1 and user2 as DL owners. if there exists DL owners they should remain as DL owners and user1 and user2 should be added as an additional DL owners. For any DL in the csv file, if there are no owners defined then user1 and user2 should be made DL owners.

dls
dl3@contoso.com
dl4@contoso.com

Can the same be achieved for office365 unified groups as well?

office-exchange-server-administrationoffice-exchange-online-itpro
· 1
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.

@RogerRoger-2394

Since this question is more related to exchange, for better user experience, we will remove other irrelevant tags.

0 Votes 0 ·

1 Answer

KaelYao-MSFT avatar image
0 Votes"
KaelYao-MSFT answered KaelYao-MSFT commented

Hi @RogerRoger-2394

i have a csv file with DL lists in the below format. i have two users user1@contoso.com and user2@contoso.com i want to remove existing DL owners by importing the csv file and make user1 and user2 as DL owners. For any DL in the csv file, if there are no owners defined then user1 and user2 should be made DL owners.

The csv file would be like:

 identity
 dl1@contoso.com
 dl2@contoso.com

The script would be like:

 import-csv C:\temp\1.csv | foreach {
     Set-DistributionGroup -identity $_.identity -ManagedBy user1,user2
 }


i have a csv file with DL lists in the below format. i have two users user1@contoso.com and user2@contoso.com i want to make user1 and user2 as DL owners. if there exists DL owners they should remain as DL owners and user1 and user2 should be added as an additional DL owners. For any DL in the csv file, if there are no owners defined then user1 and user2 should be made DL owners.

The csv file would be like:

 identity
 dl3@contoso.com
 dl4@contoso.com

The script would be like:

 import-csv C:\temp\1.csv | foreach {
         Set-DistributionGroup -identity $_.identity -ManagedBy @{Add="user3","user4"}
     }


Can the same be achieved for office365 unified groups as well?

To manage Office 365 groups, you may need to use Add-UnifiedGroupLinks instead.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.

· 1
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.

Hi @RogerRoger-2394

Just checking in to see if above information was helpful. Please let us know if you would like further assistance.

0 Votes 0 ·