Bits & Bytes

The BitTitan Blog for Service Providers

10/27/2020
Pablo Galan
People interacting with charts and analyzing statistics. Data vi

Get MigrationWiz Project Statistics and Error Reports Automatically

One of the biggest advantages to working with BitTitan is leveraging PowerShell scripting for project management. While MigrationWiz has numerous capabilities built directly into the tool itself, using scripts to help manage users, adjust project settings, and monitor status is an easy way to step outside the UI and automate additional components of your project.

This PowerShell series on Bits & Bytes has been spotlighting helpful scripts now available on Github.

Today, we’re introducing a script to easily generate migration statistics and error reports for all your MigrationWiz projects – without using the UI. The script can also be executed in unattended mode by passing parameters.

 

Why Should You Use PowerShell?

Generating the migration statistics and errors reports of several MigrationWiz projects requires going project by project and clicking on the Send Project Statistics By Email button. When having dozens or even hundreds of MigrationWiz project created under an account it can be a tedious task. In that case, it is much faster executing this script because it will automate the entire process without human interaction.

Prerequisites

  1. Create a BitTitan account from bittitan.com/account/register.
  2. Once logged in to your BitTitan account:
    • Create a Customer instance under the Customer tab
    • Create MigrationWiz projects and submit migrations
  3. Install the BitTitan PowerShell SDK Setup msi file.
  4. Download the PowerShell script Get-MWMigrationProjectStatistics.ps1 from the BitTitan GitHub repository

 

Script Session

The script uses some global variables to store session information to not have to provide the BitTitan workgroup Id, customer instance Id, MigrationWiz project Id, etc… on every execution. If you want to start a new session from the same command shell run this:

Get-Variable bt* -Scope Global | Remove-Variable

 

Execution

Open a Windows PowerShell or BitTitan Command Shell and execute:

.\Get-MWMigrationProjectStatistics.ps1 -Parameter1 Value1 -Parameter2 Value2

This script reads credentials from your machine credentials manager to run unattended, so you need to:

1- Go to your machine Credential Manager > Windows Credential

2- Add a new Generic Credential

3- On the ‘Internet or network address’ field enter: https://migrationwiz.bittitan.com

4- Enter username and password and save

If the credentials don´t exist in your machine credentials manager during execution, the script will prompt for your BitTitan account credentials:

 

image

 

This will be saved in the Windows Credential Manager as target ‘https://migrationwiz.bittitan.com’. If they are correct, you will be connected to BitTitan PowerShell SDK:

 

image

 

With this complete, you will not need to provide these credentials again for future script executions:

 

image

 

The script exports to CSV files the MigrationWiz project statistics and the project error list of a selected project or of all projects under a Customer to CSV files under a provided folder path.

 

This script accepts all these parameters. In case a mandatory parameter is not provided, an interactive menu will be displayed for the user to directly select what is missing from the menu:

-OutputPath

-BitTitanWorkgroupId

-BitTitanCustomerId

-BitTitanProjectId

-BitTitanProjectType (‘Mailbox’,’Archive’,’Storage’,’PublicFolder’,’Teamwork’)

-ProjectNamesCsvFilePath

 

  1. Parameter OutputPath

This parameter defines the folder path where the migration statistics and errors reports will be placed.

This parameter is optional. If you do not specify an output folder path, the script will prompt for it in a folder selection window.

 

  1. Parameter BitTitanWorkgroupId

This parameter defines the BitTitan Workgroup Id grabbed from the customer URL in MSPComplete.

This parameter is optional. If you do not specify a BitTitan Workgroup Id, the script will display a menu for you to manually select the workgroup.

 

  1. Parameter BitTitanCustomerId

This parameter defines the BitTitan Customer Id.

This parameter is optional. If you do not specify a BitTitan Customer Organization Id, the script will display a menu for you to manually select the customer.

 

  1. Parameter BitTitanProjectId

This parameter defines the BitTitan project Id.

This parameter is optional. If you do not specify a BitTitan project Id, the script will display a menu for you to manually select the project.

If you also provide BitTitanMigrationScope and BitTitanMigrationType, NOT providing a BitTitanProjectId will be the same as selecting all the projects under the customer.

 

  1. Parameter BitTitanProjectType

This parameter defines the BitTitan project type.

This parameter only accepts ‘Mailbox’, ‘Archive’, ‘Storage’, ‘PublicFolder’ and ‘Teamwork’ as valid arguments.

This parameter is optional. If you don’t specify a BitTitan project type, the script will display a menu for you to manually select the project type.

If you also provide BitTitanMigrationScope and BitTitanMigrationType, NOT providing a BitTitanProjectType will be the same as selecting all the projects types.

 

  1. Parameter ProjectSearchTerm

This parameter defines which projects you want to process, based on the project name search term. There is no limit on the number of characters you define on the search term.

This parameter is optional. If you don’t specify a project search term, all projects in the customer will be processed.

Example: to process all projects starting with “Batch” you enter ‘-ProjectSearchTerm Batch’

 

  1. Parameter ProjectNamesCsvFilePath

This parameter defines the file path to a CSV file with ‘ProjectName’ columns of the projects to be selected.

This parameter is optional. If you don’t specify a file path to a CSV file with ‘ProjectName’, all projects in the customer will be displayed.
-BitTitanProjectType (‘Mailbox’,’Archive’,’Storage’,’PublicFolder’,’Teamwork’)
-ProjectSearchTerm

 

Execution Examples

During the first execution, the script will prompt for your BitTitan credentials that will be save in the Windows Credentials Manager as ‘https://migrationwiz.bittitan.com’

Export all MigrationWiz project statistics and errors reports for only Document projects and with Batch1 in the project name:

.\Get-MW_MigrationProjectStatistics.ps1 -BitTitanWorkGroupId 7e476dca-9650-4c9a-ac91-5e48b58f941d -BitTitanCustomerId 50d911fc-050e-11e8-948c-00155d0021bf -BitTitanProjectType Storage -OutputPath ‘C:\Users\PabloG\OneDrive – BitTitan\Desktop\Statistics’ -ProjectSearchTerm Batch1 

Export the MigrationWiz project statistics and errors reports for a specific project:

.\Get-MW_MigrationProjectStatistics.ps1 -BitTitanWorkGroupId 7e476dca-9650-4c9a-ac91-5e48b58f941d -BitTitanCustomerId 50d911fc-050e-11e8-948c-00155d0021bf -BitTitanProjectId d04baa33-fdc5-11ea-a831-000d3af5aefb  -OutputPath ‘C:\Users\PabloG\OneDrive – BitTitan\Desktop\Statistics’

 

Related Posts

Migrate Google Workspace to Microsoft 365 with MigrationWiz

Migrate Google Workspace to Microsoft 365 with MigrationWiz

Migrate Google Workspace to Microsoft 365 with MigrationWiz Winter break is once again on the horizon. If you’re running IT at an educational institution, you may be dreaming of a few weeks on a quiet campus where you can tackle some of your bigger projects. While...

Related Posts

Migrate Google Workspace to Microsoft 365 with MigrationWiz

Migrate Google Workspace to Microsoft 365 with MigrationWiz

Migrate Google Workspace to Microsoft 365 with MigrationWiz Winter break is once again on the horizon. If you’re running IT at an educational institution, you may be dreaming of a few weeks on a quiet campus where you can tackle some of your bigger projects. While...

Register for a FREE BitTitan Account

Create an account now and start planning your project.