BitTitan MigrationWiz Resource Migrations Revisited

A while ago, I wrote about a script that I had built for creating BitTitan MigrationWiz connectors with the parameters necessary to do bulk resource mapping.  This worked pretty well, until I downloaded the newest version of the PowerShell module when I had to do it for a customer that was already partway through their migration.

The challenge I met with was two-fold--the module name I specified in #Requires was wrong (it has been updated), and I wanted to add parameters to a mailbox connector that was already configured (because I didn't know the source credentials necessary to create a new one).

Long story short, I updated the script that the blog points to.

The new parameter is -UseExistingConnector.  You'll still need to specify the name of the MigrationWiz mailbox connector (like you do in a normal connector creation).  You can get mailbox connector names by looking in the MigrationWiz portal or by running Get-MW_MailboxConnector | Select Name.

The Set-MW_MailboxConnector cmdlet is interesting; rather than using a Connector Name or Connector ID (like the cmdlets do when you add a mailbox), you actually need to use a Connector object ( $Connector = Get-MW_MailboxConnector | ? { $_.Name -eq "Connector Name"} , for example).

Another interesting tidbit that I had to take into account (it's always fun revisiting tools you created several months previous to revise them) is that in MigrationWiz, the options in AdvancedOptions look like they'd be an array or a hashtable (a list of attributes and properties, formatted like a=1), but instead of being formatted as such, from PowerShell's perspective, it's just a string.

To make sure I captured and formatted it correctly, I had to make sure I added a space before I added the existing connector properties:

 {
 $ExistingConnector = Get-MW_MailboxConnector -Ticket $Ticket | ? { $_.Name -eq $ConnectorName }
 $ConnectorId = $ExistingConnector.Id.ToString()
 # Added because MW Advanced Options are space-separated
 $ConnectorAdvancedOptions += " "
 $ConnectorAdvancedOptions += $ExistingConnector.AdvancedOptions
 Set-MW_MailboxConnector -Ticket $Ticket `
  -MailboxConnector $ExistingConnector `
  -AdvancedOptions $ConnectorAdvancedOptions
}

UseEwsImportImpersonation=1 was the existing value in the connector's Advanced Options, and you can see it appended here at the end:

 PS C:\> $ConnectorAdvancedOptions
RecipientMapping="googlecustomer.org_m2m0k3k84c3qt334fvn3j1iv04@group.calendar.google.com->" RecipientMapping="googlecustomer.org_a66f50qrpnjesce0986ppukfb8@group.calendar.google.com->" MigrateGmailAllCalendar=1 UseEwsImportImpersonation=1

At any rate, the updated script is available on the Gallery. :-)