Improvements in Error Handling in version 2.4.8.x
One of the core goals of version 2 of the Distribution List Migration module is to provide a full fidelity migration. The script incorporates a great deal of error checking to validate necessary dependencies, to track process, and to terminate on critical errors. In some instances, this error handling may have been slightly aggressive.
For example:
-
During recipient validation, the script immediately failed when encountering “recipient not present” in Office 365. If a member of the distribution list was not present in Office 365 the script would immediately fail (and indicate that the user was not present). The issue is that if multiple users are not present and the administrator continues to migrate the same distribution group, the module fails multiple times. In the latest version, the script now performs all prerequisite checks up front and ends after all checks have completed. At the end of the log file there is a section that lists all encountered issues so the admin can take bulk actions as appropriate and then attempt the distribution list migration.
-
After the Office 365 distribution list is successfully created, an attempt to add a proxy address or a member fails. After the distribution list is created in Office 365, the module attempts to mirror the full settings of the on-premises group. This includes resetting all single and multi-valued attributes. If during the distribution list migration, a user was also deleted that was a member of the group, the migration would immediately fail when attempting to add that user. This subsequently would fail all future operations from occurring and require the administrator to perform the rest of the migration manually. The module now attempts to perform operations in bulk, and if an error is encountered the script then attempts each operation individually. For example, if the group contained 300 users update-DistributionGroupMembership is called to attempt to add everyone at one time. If the bulk add fails the module then iterates through each member attempting the add. If an error is encountered the failure is recorded and the module proceeds with the migration. The migration will be marked in a failed state and the summary status at the end of the log file will show all the dependencies that failed. This allows the administrator to evaluate each dependency and make any manual adjustments as required.
- When completing the migration, the module attempts to reset all on-premises dependencies. When the migration is complete it may become necessary to update resources on premises with the migrated group information. For example, if the migrated distribution list was a member of another distribution group the module automatically adds the mail routing contact to the on-premises distribution list. If the operation to address any of these dependencies failed the entire module would have failed. As with other functions the module now tracks the failures and generates an error report for administrator review.
Here is sample of the log summary section that the administrator could review for a potential manual fix. Each of the errors generated should contain information regarding the object modified, the attribute failed, and a brief description of why the operation failed.
+++++
[10/4/2021 9:23:03 PM] – ++++++++++
[10/4/2021 9:23:03 PM] – MIGRATION ERRORS OCCURED – REFER TO LIST BELOW FOR ERRORS
[10/4/2021 9:23:03 PM] – ++++++++++
[10/4/2021 9:23:03 PM] – +++++
[10/4/2021 9:23:03 PM] –
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – Distinguished Name: CN=TestErrorHandingCloud,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:03 PM] – Primary SMTP Address: TestErrorHandingCloud@domain.onmicrosoft.com
[10/4/2021 9:23:03 PM] – Alias: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Display Name: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Attribute in Error: Distribution List AcceptMessagesOnlyFromSendersOrMembers
[10/4/2021 9:23:03 PM] – Error Message: Unable to add mail routing contact to Office 365 distribution group. Manual add required.
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – Distinguished Name: CN=TestErrorHandingCloud,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:03 PM] – Primary SMTP Address: TestErrorHandingCloud@domain.onmicrosoft.com
[10/4/2021 9:23:03 PM] – Alias: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Display Name: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Attribute in Error: Distribution List BypassModerationFromSendersOrMembers
[10/4/2021 9:23:03 PM] – Error Message: Unable to add mail routing contact to Office 365 distribution group. Manual add required.
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – Distinguished Name: CN=TestErrorHandingCloud,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:03 PM] – Primary SMTP Address: TestErrorHandingCloud@domain.onmicrosoft.com
[10/4/2021 9:23:03 PM] – Alias: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Display Name: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Attribute in Error: Distribution List GrantSendOnBehalfTo
[10/4/2021 9:23:03 PM] – Error Message: Unable to add mail routing contact to Office 365 distribution group. Manual add required.
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – =====
[10/4/2021 9:23:03 PM] – Distinguished Name: CN=TestErrorHandingCloud,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:03 PM] – Primary SMTP Address: TestErrorHandingCloud@domain.onmicrosoft.com
[10/4/2021 9:23:03 PM] – Alias: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Display Name: TestErrorHandingCloud
[10/4/2021 9:23:03 PM] – Attribute in Error: Distribution List ManagedBy
[10/4/2021 9:23:03 PM] – Error Message: Unable to add mail routing contact to Office 365 distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandlingDynamic,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandlingDynamic@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List AcceptMessagesFromSendersOrMembers
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 dynamic distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandlingDynamic,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandlingDynamic@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List BypassModerationFromSendersOrMembers
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 dynamic distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandlingDynamic,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandlingDynamic@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandlingDynamic
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List GrantSendOnBehalfTo
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 dynamic distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandlingUniversal_791e15e2-2633-4391-a80e-4cbdb935c027,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandlingUniversal@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandlingUniversal
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandlingUniversal
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List AcceptMessagesOnlyFromSendersOrMembers
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 univeral modern distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandlingUniversal_791e15e2-2633-4391-a80e-4cbdb935c027,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandlingUniversal@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandlingUniversal
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandlingUniversal
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List GrantSendOnBehalfTo
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 universal modern distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] – Distinguished Name: CN=TestErrorHandingCloud,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR04A004,DC=prod,DC=outlook,DC=com
[10/4/2021 9:23:04 PM] – Primary SMTP Address: TestErrorHandingCloud@domain.onmicrosoft.com
[10/4/2021 9:23:04 PM] – Alias: TestErrorHandingCloud
[10/4/2021 9:23:04 PM] – Display Name: TestErrorHandingCloud
[10/4/2021 9:23:04 PM] – Attribute in Error: Distribution List Membership
[10/4/2021 9:23:04 PM] – Error Message: Unable to add mail routing contact to Office 365 distribution group. Manual add required.
[10/4/2021 9:23:04 PM] – =====
[10/4/2021 9:23:04 PM] –
[10/4/2021 9:23:04 PM] – +++++
[10/4/2021 9:23:04 PM] – ++++++++++
[10/4/2021 9:23:04 PM] – Errors were encountered in the distribution list creation process requireing administrator review.
[10/4/2021 9:23:04 PM] – Although the migration may have been successful – manual actions may need to be taken to full complete the migration.
[10/4/2021 9:23:04 PM] – ++++++++++
If there are critical operations that should still trigger a failure (for example, failure to create the distribution list in Office 365) a hard stop will still occur. But by aggregating minor errors, migration can proceed while flagging issues for administrator review at a later time.