Learn what you need to know about connecting the BitTitan PowerShell to your BitTitan account. This is your first step before running the BitTitan scripts and automation.
When you install and open the BitTitan PowerShell module, default actions will send requests to our BitTitan.com platform.
To change the environment you're connecting to, you'll use two cmdlets:
- Set-MW_Environment - This changes the MigrationWiz environment and will cover any *-MW* cmdlets, corresponding to the migrationwiz.bittitan* website.
- Set-BT_Environment - This changes the BitTitan environment and will cover any *-BT* cmdlets, corresponding to the manage.bittitan.* website.
You might need to use one or both of the cmdlets above, depending on the tasks you want to accomplish.
Common "*-MW*" tasks will include starting MigrationWiz migrations with the Add-MW_MailboxMigration cmdlet, or creating a MigrationWiz project with the Add-MW_MailboxConnector cmdlet, among many others.
Common "*-BT*" tasks will include listing your customers with the Get-BT_Customer cmdlet, or scheduling a DeploymentPro user with the Start-BT_DpUser cmdlet, among many others.
Our BitTitan cmdlet reference page shows many environments that can be set. These are the relevant externally-available environments that apply for both BT and MW cmdlets:
BT Represents BT
China Represents China
German Represents Germany
For example, to change your PowerShell environment to Germany, open your PowerShell module and run the following:
Set-BT_Environment -Environment Germany
Set-MW_Environment -Environment Germany
Be sure to include those lines in your scripting in order to run consistently in your chosen environment. Keep in mind that you can't run commands in two different environments for MW or BT in the same session - you’ll need to manually switch environments. To switch back to BitTitan’s .com platform, use the value BT.
Learn about and create a ticket
Once you ramp up your skills using our SDK, you'll soon learn you can't do anything without a ticket.
What is a ticket?
A ticket in the BitTitan PowerShell module is an authentication token with several parameters you’ll use each time you execute an action. The main parameters of the ticket are:
- WorkgroupID - You can create a ticket specifically to a BitTitan Workgroup
- IncludeSharedProjects - When set to “true” this is the parameter that allows you to see all projects and not just the ones you created. This parameter is exclusive for MW tickets
- ExpirationDate – You’ll see this when the ticket expires. Tickets are, by default, valid for 1 week.
How do I create a ticket?
You need to create one ticket specific for MW actions and one for BT actions, using the following cmdlets:
$MWTicket = Get-MW_Ticket -Credentials (Get-Credential)
$BTTicket = Get-BT_Ticket -Credentials (Get-Credential)
You can then leverage those tickets each time you run a cmdlet, for example:
Get-MW_Mailbox -Ticket $MWTicket
Get-BT_Workgroup -Ticket $BTTicket
Create a MigrationWiz ticket with project sharing
MigrationWiz enables collaboration. If you’re using the UI or PowerShell, you can access and manage all objects within a workgroup, whether you created them or not.
We highly recommend that you use project sharing at all times. You’ll find a check box in the UI for project sharing. But with PowerShell, project sharing is determined by how you create your ticket. Let's look at how to create a ticket with sharing enabled.
First, you’ll need to add two parameters to the cmdlet:
Here's the completed command:
$MWTicket = Get-MW_Ticket -Credentials (Get-Credential) -WorkgroupId [yourworkgroupid] -IncludeSharedProjects
You can obtain your workgroup ID either by running the Get-BT-Workgroup cmdlet or by copying it from the URL in your browser when you're inside the workgroup.
BT tickets do not need project sharing, this only applies to MW tickets.
The Bottom Line
This information will help you understand how to connect and authenticate to BitTitan systems via the SDK and all the options you have to incorporate in your scripts.