Convert unified group to DL

Glenn Maxwell 10,146 Reputation points
2021-04-07T17:40:00.907+00:00

Hi All

I have an office 365 unified group, can i covert it to office 365 distribution list. will the users loose membership?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,607 questions
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,174 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,345 questions
0 comments No comments
{count} votes

Accepted answer
  1. JoyZ 18,041 Reputation points
    2021-04-08T06:24:49.963+00:00

    Hi @Glenn Maxwell ,

    Agree with michev.

    Script to "convert" Unified Groups to Distribution Lists.

    The script first gets a list of Unified Groups and saves it in a constant.

    $Groups = Get-UnifiedGroup -ResultSize Unlimited  
    

    It then gets the PirmarySmtpAddress for each group.

    $Groups | ForEach-Object {  
    $group = $_  
    $GroupEmail = Get-UnifiedGroup -Identity $group.Name | select PrimarySmtpAddress  
    

    Next, we get the Members from each group and save them.

    Get-UnifiedGroupLinks -Identity $group.Name -LinkType Members | ForEach-Object {  
    New-Object -TypeName PSObject -Property @{  
    Group = $group.DisplayName  
    GroupEmail = $GroupEmail.primarysmtpaddress  
    Member = $_.Name  
    EmailAddress = $_.PrimarySMTPAddress  
    RecipientType= $_.RecipientType  
    

    We then export the members, import the members that are sorted by unique group email.

    Export-CSV “C:UnifiedGroupMembers.csv” -NoTypeInformation -Encoding UTF8  
    $distro = Import-Csv C:UnifiedGroupMembers.csv | sort GroupEmail –Unique  
    

    Now we delete the Unified Group and insert a pause of 30 seconds

    $distro | foreach{Remove-UnifiedGroup -Identity $_.GroupEmail -force}  
    Start-Sleep -s 30  
    

    Lastly we create Distribution list with the members that we got from the Unified Groups.

    $distro | foreach{New-DistributionGroup -Name $_.Group -primarysmtpaddress $_.GroupEmail}  
    Import-CSV “C:UnifiedGroupMembers.csv” | foreach {Add-DistributionGroupMember -identity $_.GroupEmail -member $_.EmailAddress}  
    

    As a supplement, when a Unified Group is created there is a Calendar, OneNote, SharePoint Online site and a OneDrive for business Storage added to it.

    If your users start using this feature, then the data within those locations will be deleted.

    More information for your reference:

    https://github.com/oliveir3/Convert-Office-365-Groups

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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.


2 additional answers

Sort by: Most helpful
  1. Vasil Michev 95,181 Reputation points MVP
    2021-04-07T17:57:30.82+00:00

    There's no "conversion" process from O365 Group to DL, only in the other way. For your scenario, you will need to manually create a DL and populate it with the membership of the O365 Group.

    2 people found this answer helpful.
    0 comments No comments

  2. xoxidein 31 Reputation points
    2022-08-22T14:54:18+00:00

    I'm getting "Missing '=' operator after key in hash literal" on the Export-Csv line

    0 comments No comments