This script is intended to demonstrate how an Exchange Online distribution group can be converted to an Office 365 Group. Only mailboxes are supported in Office 365 Groups, so these are the only recipients moved across. The settings of the distribution group are moved as is its email address (you might not like to do this). Some bugs are still present in the PowerShell cmdlets for Office 365 groups (such as the AccessType parameter to differentiate between public and private groups), but these will be fixed over time. No guarantee is given as to the usefulness or validity of the code!

Make sure that your PowerShell session is connected to Exchanage Online and then run the script, providing the alias of the distribution group to convert as the parameter. The following processing is performed: