How to update a Dynamic Distribution Group Recipient Filter

During an Office 365 / Exchange Online migration, you may have a requirement to update the recipient filter of any dynamic distribution group.

In my case, I needed to do this because the dynamic distribution group used filters to include only mailboxes. But mailboxes that are migrated to Office 365 become mail-enabled users in the on-premises directory. This can cause issues with certain members of a dynamic distribution group not receiving email messages. The issue is described here read more