Monthly Archives: October 2021

Office 365 – Distribution List Migration Version 2.0 – Part 12

Announcing multiple migration machine support

Over the course of its development, the Distribution List Migration v2 has continued to add support for more than one distribution list operation. In version 2.4, these capabilities were extended from running a bulk migration on a single machine to running a bulk migration across multiple machines.

The purpose of migrating distribution lists across multiple machines allows us to:

  • Use more than one authentication account for Office 365 operations (eliminates throttling concerns);
  • Use more than one authentication account for on-premises operations including Active Directory and Exchange;
  • Have up to 25 simultaneous migrations running at a single time; and
  • Centrally track migrations happening across multiple migration endpoints.

The module accomplishes multiple machine migrations by leveraging the single host bulk migration process previously released. The administrator designates a single machine to execute the migration. If this machine is also included in the list of migration endpoints, multiple migrations will be performed on that host. If the server executing the migrations is not included on the list of machines to execute migrations, the machine acts as a controller and remotely creates the multiple migration jobs on the remote hosts. The script supports up to 5 hosts performing the migrations (in the event that a controller is used this does not count as a migration host).

To support these types of migrations, the script makes several changes to the commands used to invoke the script. In this section I’ll review the changes and then look at a sample command.

  • Array of group is supplied to the groups rather than a single email address.

    When invoking a multi-machine migration, the assumption is that multiple groups will be migrated. The group SMTP addresses allows the administrator to provide an array of SMTP addresses for migration. The list of addresses is divided evenly between each host with any extra being added to the last host used for migrations. In this example 202 smtp addresses are provided in the array of addresses. If the administrator specifies 5 hosts then 40 migrations are scheduled on hosts 1-4 with host 5 having 42 migrations scheduled.

    To create the list of groups I recommend using a text file and listing the groups of addresses to be migrated. This text file can then be imported into a variable for use in the command.

    Sample Group Text File saved as c:\info\groups.txt

    DistributionList1@contoso.com

    DistributionList2@contoso.com

    DistributionList3@contoso.com


    DistributionList105@contoso.com

    $groups = get-content c:\info\groups.txt

  • Array of migration hosts is supplied. This list represents the machines that will perform the migration tasks. The list has the fully qualified domain name of each host. Each host is required to have the same pre-requisites as a single machine. Please review the single machine migration prerequisites. To create the list of migration hosts I recommend using a text file and listing the fully qualified domain names on each line. This test file can then be imported into a variable for use in the command.

    Sample Group Text File save as c:\info\machines.txt

    Azure-Mig-0.domain.com

    Azure-Mig-1.domain.com

    Azure-Mig-2.domain.com

    Azure-Mig-3.domain.com

    Azure-Mig-4.domain.com

    $machines = get-content c:\info\machines.txt

  • Each set of credentials is now an array of credentials. The administrator may specify one or more credentials to be used during the migration. It is a requirement that a credential be supplied for each migration host even if the same credential is used across all hosts. If using more than 3 migration machines multiple Exchange Online credentials will be required in order to avoid PowerShell throttling. In testing multiple credentials were not required for Active Directory, Azure AD Connect, or Exchange on-premises but the script does allow for these. Specific testing should occur to ensure that Active Directory Web Services which is used for the module to perform remote Active Directory calls is not overloaded when using a single account. If Active Directory timeouts or errors occur in the logs consider using more than one administrator.

    The following example shows how multiple credentials may be captured.

    $creds=@() #Create empty array of credentials

    $creds+=get-credential #Request a set of credentials interactively. Repeat once for each host. Specify the same or different credentials

    The following example shows how multiple credentials may be captured from credentials stored within XML files on the migration controller.

    $creds=@() #Create empty array of credentials

    $cred1 = import-clixml c:\info\cred1.xml

    $cred2 = import-clixml c:\info\cred2.xml

    $cred3 = import-clixml c:\info\cred3.xml

    $creds+=$cred1

    $creds+=$cred2

    $creds+=$cred3

    As a reminder it is required to specify a credentials array that contains one set of credentials for each migration host even if the credentials are the same.

  • The administrator specifies a remote drive letter to use for centralized log file storage.

    On the migration controller the log directory is automatically shared out. Permissions are restricted to each account specified in the credentials array for Active Directory and each hosts machine account performing migrations. The shared directory serves as the centralized logging location for all of the hosts performing migrations. Each host creates an individual folder in this directory. On the migration hosts themselves the specified drive letter is automatically mapped on the host to the centralized share. The log directory is updated to force logging operations to occur on the network share. This allows information for multiple migrations to be aggregated in a single location for success and error analysis. The mapped drive is removed at the conclusion of the migration operation. The share on the migration controller is maintained.


  • If the administrator has selected to pre-collect data such as folder permissions or send as rights, the pre-collection files must be in the AuditData folder in the logging directory of the migration controller. For example, if c:\temp is used as the log folder patch on the migration controller the AuditData folder must be at c:\temp\AuditData. The script automatically creates a sub directory for each migration host and copies the AuditData folder to it to avoid file contention when attempting to import the data for analysis.

    An administrator may invoke a migration by using the sample command:

    Start-MultipleMachineDistributionListMigration -groupSMTPAddresses $groups -globalCatalogServer GC.domain.com -activeDirectoryCredential $creds -aadconnectServer adconnect.domain.com -aadConnectCredential $creds -exchangeServer webmail.domain.com -exchangeCredential $creds -exchangeOnlineCredential $creds -logFolderPath c:\temp -remoteDriveLetter S -servers $machines -enableHybridMailFlow:$TRUE

    The following shows a sample flow diagram of multiple machine migrations.

 

 

The logs for the controller are stored on the migration controller in the log file directory. The controller log keeps the summary of the PowerShell jobs dispatched and at the end of the migration will scan all individual migration folders for success or failure. The administrator may then review the individual migration logs contained in each servers directory to troubleshoot any issues.

Happy migrating!

Office 365 – Distribution List Migration Version 2.0 – Part 11

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.