No Method Available in Office 365
Rather curiously, Office 365 has never included an out-of-the-box method to migrate a distribution list from an on-premises Exchange organization to Exchange Online. When an on-premises organization is synchronized with Exchange Online in a hybrid deployment, the suggested method is to remove the distribution list from on-premises and recreate it as a brand-new object in the cloud. For anything but simple lists with just a few members, this is a tiresome process, but it reflects the fact that transferring a distribution list to the cloud can be quite complex. Among the reasons why this is so include:
- The owner(s) of the distribution list might not have their account(s) in the cloud. An on-premises user cannot manage a cloud-based distribution list.
- Objects for mail-enabled members of the distribution list might not exist in the cloud. For example, a mail contact in the on-premises environment might not be synchronized to the cloud.
- The distribution list might hold other distribution lists.
- The proxy addresses for the on-premises distribution list must be transferred to the new list.
- Some properties of distribution lists refer to other directory objects that must exist in the target environment before they can be used. For example, the property controlling the ability of users to send email on behalf of the list.
Scripting a Solution
It is possible to write a PowerShell script to concurrently connect to Exchange on-premises and Exchange Online and perform the processing to transfer a distribution list. The script must:
- Check that all the prerequisites are satisfied for the transfer to go ahead. For example, are all the members of the list known in the cloud.
- Create the target distribution list in Exchange Online.
- Read information about the source distribution list from Exchange on-premises and update the properties of the target distribution list.
- Assign a new proxy address to the source distribution list and transfer it to the target distribution list.
- Update the membership of the target distribution list with the membership of the source list.
- Hide the source distribution list from address lists so that the only list that is visible to users is the target. Eventually, if the transfer worked and no problems are found, the old list is removed.
Tim McMichael of Microsoft has shared an example of a migration script for distribution lists in GitHub (the documentation is here). Even though Tim’s a very nice guy and ultra-competent, as with any script, you should test it carefully and adapt where necessary to meet the needs of your deployment.
We cover distribution lists and how to manage these workhorses of Exchange in Chapter 7 of the Office 365 for IT Pros eBook.