Logo

Documentation home for Transend tools

Microsoft 365 Initialize Drives script

Use m365_initialize_drives.ps1 to provision OneDrive for users before migrating their files. A licensed Microsoft 365 user may not have a OneDrive site until the user opens OneDrive for the first time; pre-provisioning creates that destination in advance so Transend Migration Console can begin transferring content without waiting for user activity. By default the script processes users who do not already have a drive, submits requests in batches, and waits to confirm provisioning. Use -Csv to limit the users or -NoWait to return after submitting the requests.

Setup

  1. Download TMCTools.
  2. From the TMCTools zip file, extract common.psm1, m365.psm1 and m365_initialize_drives.ps1 from the TMCTools/bin folder.
  3. Ensure you have created the required app using m365_initialize_app.ps1.

Usage

.\m365_initialize_drives.ps1
  -AppId <AppId>
  -AppSecret <AppSecret>
  -TenantId <TenantId>
  -SharePointDomain <SharePointDomain>
  [-Csv <Csv>]
  [-BatchSize <BatchSize>]
  [-NoWait]
  [-CloudEnvironment <Default | DoD | GCCHigh | China | Germany>]

Parameters

Parameter Required Values Description
-AppId Yes App ID The application ID to use for authentication.
-AppSecret Yes App secret The application secret to use for authentication.
-TenantId Yes Tenant identifier The tenant ID to connect to.
-SharePointDomain Yes SharePoint domain The SharePoint domain to connect to.
-Csv No Path to a CSV file A CSV file containing a list of objects to process.
-BatchSize No Integer from 1 through 200; default: 200 The number of users to process at a time. Defaults to 200.
-NoWait No Switch Request drive provisioning and return without polling for completion.
-CloudEnvironment No Default, DoD, GCCHigh, China, Germany The cloud environment to connect to. Use this option if your tenant is not in the worldwide cloud.

Examples

Example 1: Configure all users for drive migration

.\m365_initialize_drives.ps1 -AppId '8b26caf2-2ef6-4a9d-9c27-98616d1c1294' -AppSecret '9pitRZoTezs6M0b~bgcibEfkG6qMaczuNV25Ol6m' -TenantId 'example.org' -SharePointDomain 'example'

Example 2: Configure select users for drive migration

To limit the users for which drives will be configured, you’ll need to create a CSV with a single field named Identity that includes any of the following attributes:

  • ID
  • UPN
  • Email address
  • Display name

For example:

Identity
user1@example.org
user2@example.org
user3@example.org
.\m365_initialize_drives.ps1 -AppId '8b26caf2-2ef6-4a9d-9c27-98616d1c1294' -AppSecret '9pitRZoTezs6M0b~bgcibEfkG6qMaczuNV25Ol6m' -TenantId 'example.org' -SharePointDomain 'example' -Csv 'C:\Temp\users.csv'

Troubleshooting

  • Review the log file in your Documents directory for more information.
  • If -NoWait is omitted, the script polls for provisioning completion after submitting requests.