Hi @Roger Roger
i have a csv file with DL lists in the below format. i have two users user1@Company portal .com and user2@Company portal .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@Company portal .com and user2@Company portal .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.