Upgrade Distribution Lists to Microsoft 365 Groups Using PowerShell

It will soon be deprecated to upgrade distribution lists to Microsoft 365 groups using the Exchange admin center and PowerShell cmdlets. Yes, Microsoft has announced that this deprecation would take place on Feb, 2023. As Office 365 admins, we know that after the deprecation, the requirements to upgrade the distribution lists into Microsoft 365 groups will become a complex one. 

Don’t worry, we are providing the best way to migrate your distribution lists to Microsoft 365 groups using PowerShell. 


Why Should You Upgrade Distribution Lists to Microsoft 365 Groups? 

Distribution Lists are contact groups in Outlook that serve the purpose of email communication well where as Microsoft 365 groups provide a collaborative space and access to a vast collection of resources for team collaboration.  

M365 group provides a shared inbox, shared calendar, shared files library, shared OneNote notebook, and much more to the group members. However, distribution groups are just for sending an information to users through an email. 

Thus, upgrading the distribution lists to Microsoft 365 group will help you to have a flexible and advanced space for collaboration and communication. After migration, you will have more control over your data, all permissions, and management. 


Check the Eligibility of Office 365 Distribution Lists for Migration 

All distribution lists cannot be converted to Microsoft 365 groups due to certain conditions. Those which are simple, non-nested, and cloud-managed can only be converted into groups of M365. Then the criteria for non-eligibility of distribution lists is way more to explain. 

Thus, run the following cmdlet to get the eligible Office 365 distribution groups with their primary SMTP address for migration. Before running the command, make sure you are connected to the Exchange Online PowerShell module. 


get eligible distribution groups for migration of distribution lists to Microsoft 365 groups


Native Upgrade Methods of Distribution Lists that are Under Deprecation! 

After checking the eligibility of distribution groups, let us see the direct methods of converting distribution lists to Microsoft 365 groups under deprecation.  

  1. Exchange admin center: Distribution lists are migrated to Microsoft 365 group in the Exchange admin center using the ‘Change group type’ option. You can access this option by navigating to Exchange admin center -> Recipients -> Groups -> Distribution list > Select the Group name -> Change group type.
  2. PowerShell: Distribution lists can be easily upgraded to Microsoft 365 groups using the PS cmdlet ‘Upgrade-DistributionGroup’. 

As these above methods will be no longer in use, Microsoft has provided an alternative solution to migrate distribution lists to M365 groups. 

  1. Create a Microsoft 365 group with a temporary name and mail address. 
  2. Then, export the distribution list members through PowerShell. 
  3. Add the exported CSV file under Azure Active Directory -> Groups -> All groups -> (Newly created group) -> Members-> Bulk operations -> Import members. 
  4. Update the Microsoft 365 group with the basic attributes of the distribution list after deleting them. 

However, the above suggested method turns out to be a time-consuming one if your organization has more number of distribution groups. 

Thus, to lend you a hand, we have prepared a PowerShell script that automates the process and eases your conversion.  As it migrates the distribution groups more securely in no time and without much human intervention, let us dive deep into the script and its features.     


 Script Download: ConvertDLtoM365Group.ps1 


Script Highlights: 
  • The script is executed with both MFA and non-MFA-enabled accounts. 
  • Installation of the Exchange Online V3 PowerShell module is done automatically (if not installed on your PowerShell environment) upon your confirmation. 
  • The script uses modern authentication to connect to Exchange Online. 
  • A non-member of the distribution group can also run this script. 
  • Bulk conversion is possible using the script. 
  • An update option is available i.e., you can update the group name, mail address, and access type after creating the group. 
  • The script is scheduler-friendly i.e., credentials can be passed as parameters instead of getting interactively.  


How to Execute the Script? 

Method 1: To execute the script with MFA and non-MFA accounts. 

Method 2: To execute the script by explicitly mentioning the credentials only for non-MFA accounts. 

Method 3: Execute the script for bulk conversion of distribution lists to Microsoft 365 groups. 

Enter your input file path shown in the screenshot given below. 

Input file to Upgrade Distribution lists to Microsoft 365 Groups

After executing the script, you may encounter an error message stating “Removed existing Distribution List does not updated…Waiting for 5 seconds,” which indicates that there may be a delay in deleting the old distribution lists and creating new groups.  

It is important to note that this error message does not necessarily mean that the script has failed to run. Therefore, we recommend to be patient and wait for the process to complete. 


Steps to Migrate the Distribution Lists to Microsoft 365 Groups Using PowerShell Script 

Step 1: Provide the distribution group mail address as an input 

Primarily, it requests the credentials of your Office 365 account to access the distribution groups you want to convert. Enter your credentials to log in to your account. 

Once you have connected to Exchange Online, it asks for your Outlook distribution lists’ mail addresses to convert them. If you want to list a few, then enter them separated by a comma.  

Note: You can’t convert the distribution list to Microsoft 365 group, if it has any groups as a member or owner in it. 

Provide the mail address for upgrading distribution lists to Microsoft 365 groups 

Step 2: Define Microsoft 365 Group Privacy 

Once the group is found eligible, it asks you to define the access type of Microsoft 365 group to Private or Public. 

Note: If the access type is not specified or misspelled, then the access type is defined as Private by default

Access type of Microsoft 365 group for distribution list migration 

Once you have entered all the inputs, the script creates a M365 group and moves all the members to it.  

Also note that, if you are the distribution list owner and running the script, you will be added as both member and owner into the created Microsoft 365 group. 

Step 3: (Optional) Update the basic attributes of Microsoft 365 Group

You can alter or update the basic attributes of the M365 group such as group name, group mail address and the access type of the group under this option. 

Update the basic attribution after upgrading distribution lists to Microsoft 365 group


Check the Distribution Lists to M365 Group Migration Status! 

You can easily check the created M365 groups by exporting the M365 group report to a CSV file using PowerShell. This option will facilitate you with a detailed report on newly migrated Microsoft 365 groups.   

Also, you can check the newly created M365 group by navigating to the Exchange admin center -> Recipients -> Groups -> Microsoft 365 as shown below. 

Confirm the upgrade of distribution lists to Microsoft 365 groups


Thus, this script is so simple to execute and saves all your work and time. It easily converts distribution lists to Microsoft 365 groups and reduces the burden of Office 365 admins in DL migration.  

I hope this blog helps you to upgrade the distribution lists to Microsoft 365 groups using the PowerShell script. Share your opinions and thoughts in the comment section.