question

RogerRoger-2394 avatar image
0 Votes"
RogerRoger-2394 asked emilyhua-msft edited

modify DL group ownership

Hi All

i have a DLs in a csv file. These DLs have one owner user1@mydomain.com, i want to add user2@mydomain.com as a owner and remove user1@mydomain.com. please guide me how to do it from PowerShell. is the below syntax correct

dlalias
dl1@mydomain.com
dl2@mydomain.com

 $DLList = import-CSV C:\temp\list.csv 
 ForEach ($item in $DLList){Set-DistributionGroup -Identity "$DLList.dlalias" -ManagedBy @{Add="user2@mydomain.com"} -Confirm:$False -BypassSecurityGroupManagerCheck }
 ForEach ($item in $DLList){Set-DistributionGroup -Identity "$DLList.dlalias" -ManagedBy @{Remove="user1@mydomain.com"} -Confirm:$False -BypassSecurityGroupManagerCheck }


For these DLs i want to modify delivery management settings i.e enable senders inside and outside of my organization by importing csv file. experts guide me.

office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-server-mailflow
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.

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

Hi @RogerRoger-2394

This script should be modified to:

  $DLList = import-CSV C:\temp\list.csv 
  ForEach ($item in $DLList){Set-DistributionGroup -Identity $item.dlalias -ManagedBy @{Add="user2@mydomain.com"} -Confirm:$False -BypassSecurityGroupManagerCheck }
  ForEach ($item in $DLList){Set-DistributionGroup -Identity $item.dlalias -ManagedBy @{Remove="user1@mydomain.com"} -Confirm:$False -BypassSecurityGroupManagerCheck }

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.


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 avatar image
0 Votes"
RogerRoger-2394 answered KaelYao-MSFT edited

For these DLs i want to modify delivery management settings i.e enable senders inside and outside of my organization by importing csv file.

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

You may use this script and see if it works for you:

  $DLList = import-CSV C:\temp\list.csv 
  ForEach ($item in $DLList){Set-DistributionGroup -Identity $item.dlalias -RequireSenderAuthenticationEnabled $false}


0 Votes 0 ·