Google Drive ID Collection script
Use go_get_drive_ids.ps1 to inventory the shared drives in a Google Workspace account and create a CSV formatted for
Transend Migration Console. Shared-drive names are not guaranteed to be unique, so the migration project needs each
drive’s unique ID to identify the correct source. The -Target option adds the destination columns required for a
Google Workspace, Microsoft 365, or local-file migration, giving you a mapping file that you can complete and import.
Setup
- Log into the Google Cloud console.
- Click the project picker (to the right of
Google Cloud in the top navigation) and click New project.
- Give the project a name. For example, Drive ID Collection. Use the defaults for other options.
- Click Create.
- From the notifications area (bell icon), click Select Project under the newly created Drive ID Collection
project.
- Click Next -> Enable.
- Click the link to https://console.cloud.google.com/iam-admin/serviceaccounts.
- Click Select project and choose Drive ID Collection.
- Click Create service account.
- Give the service account a name. For example, Service Account. Use the defaults for other options.
- Click Done.
- Open the service account and select the Keys tab.
- Click Add key -> Create new key -> JSON.
- Click Create and make note of the download location for the key.
- Select the Details tab and make note of the Unique ID value.
- Log into the Google Workspace admin center.
- Navigate to Security -> Access and data control -> API controls.
- Click Manage Domain Wide Delegation.
- Click Add new.
- Enter the unique ID copied in Step 14.
- Enter
https://www.googleapis.com/auth/drive.readonly
in the OAuth scopes field.
- Click Authorize.
- Add your admin ID to each shared drive with Manager access.
- Download TMCTools.
- From the TMCTools zip file, extract
common.psm1, go.psm1 and go_get_drive_ids.ps1 from the TMCTools/bin
folder.
Usage
.\go_get_drive_ids.ps1
-AdminId <AdminId>
-KeyFile <KeyFile>
-Target <Google | M365 | Local>
Parameters
| Parameter |
Required |
Values |
Description |
-AdminId |
Yes |
Admin ID |
The admin ID to use for authentication. |
-KeyFile |
Yes |
Key File |
The path to the JSON key file to use for authentication. |
-Target |
Yes |
Google, M365, Local |
The provider you are migrating to. |
Examples
Example 1: Collect drive IDs for migrating to Microsoft 365
.\go_get_drive_ids.ps1 -AdminId 'admin@example.org' -KeyFile 'C:\Temp\key.json' -Target 'M365'
Example 2: Collect drive IDs for migrating to Google Workspace
.\go_get_drive_ids.ps1 -AdminId 'admin@example.org' -KeyFile 'C:\Temp\key.json' -Target 'Google'
Example 3: Collect drive IDs for migrating to the local filesystem or a file share
.\go_get_drive_ids.ps1 -AdminId 'admin@example.org' -KeyFile 'C:\Temp\key.json' -Target 'Local'
Troubleshooting
- Review the log file in your
Documents directory for more information.