Rename DLs

Roger Roger 5,446 Reputation points
2022-04-29T17:27:28.3+00:00

Hi All

i have DLs and unified groups in the below format and i want to rename them i.e DisplayName, Email Address, Alias i am using exchange 2016 hybrid environment. experts guide me
in onprem dl do i need to include primarysmtp address. any other changes do i need to make, i have seperate csv file for onprem, online & unified groups. experts correct me with the syntaxes

197798-d.jpg

ONPREM DL  
 $lists = Import-Csv "c:\temp\onpremdls.csv"  
 Foreach ($list in $lists) {  
 Write-Host $list.DN " TO " $list.DN-C  
 Set-DistributionGroup -Identity $list.Alias -DisplayName $list.DN-C -Alias $list.Alias-C  
 }  
          
 ONLINE DL  
      
 $lists = Import-Csv "c:\temp\onlinedls.csv"  
 Foreach ($list in $lists) {  
 Write-Host $list.DN " TO " $list.DN-C  
 Set-DistributionGroup -Identity $list.Alias -DisplayName $list.DN-C -Alias $Group.Alias-C -PrimarySmtpAddress $list.PSMTP-C  
 }  
          
 Unified Groups     
 $lists = Import-Csv "c:\temp\ug.csv"  
 Foreach ($list in $lists) {  
 Write-Host $list.DN " TO " $list.DN-C  
 Set-UnifiedGroup -Identity $list.PrimarySmtpAddress -DisplayName $list.DN-C -Alias $list.Alias-C -PrimarySmtpAddress $list.PSMTP-C  
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,358 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,481 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,985 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joy Zhang-MSFT 1,046 Reputation points
    2022-05-02T02:35:32.697+00:00

    Hi @Roger Roger ,

    What are specific error messages you saw after you run above scripts?

    According to your request, I have found a blog on Rename a distribution group in Exchange with Powershell for your reference and hope it help you.
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Roger Roger 5,446 Reputation points
    2022-05-01T12:48:57.42+00:00

    i am getting error executing the above syntaxes


  2. Roger Roger 5,446 Reputation points
    2022-05-15T18:37:43.623+00:00

    unable to mark as answer