Run GSMME from the command line

G Suite Migration for Microsoft Exchange

In addition to using G Suite Migration for Microsoft Exchange (GSMME) on your Windows desktop, you can run GSMME using the command-line interface. 

How to enter the commands

  1. In a command prompt (CMD), enter the cd command with the location of your GSMME installation in double quotes.

    The default locations are C:\Program Files\Google\G Suite Migration (32-bit system) or C:\Program Files (x86)\Google\G Suite Migration (64-bit system).

    Example: cd "C:\Program Files\Google\G Suite Migration".

  2. Enter the commands (see below) 
    • Each argument is preceded by a double dash (--).
    • All parameters must be enclosed in double quotes.
    • Enter the command on a single line. 

    Note: You might be prompted to enter your Exchange administrator user name and password.

Required commands

Make sure you include the required commands for your legacy environment: 

Migrating from Microsoft Exchange using an administrator profile
--exchange_profile_name="Exchange admin profile"
--filename="filename containing user list"
--service_account_json_path="json file path"
--gsuite_admin="admin email address"
Migrating from Exchange using server and administrator details
--source_server="exchange-server hostname"
--exchange_admin_login="Exchange server admin account"
--filename="filename containing user list"
--service_account_json_path="json file path"
--gsuite_admin="admin email address"
Migrating from an IMAP server

--filename="filename containing user list"
--service_account_json_path="json file path"
--imap_port="port number"
--imap_path_prefix="path prefix"
--imap_server_type="server type"
--source_server="IMAP server hostname"
--gsuite_admin="admin email address"

For administrator-mode migrations from Cyrus also use:

--imap_admin_id="Cyrus IMAP admin"
--imap_admin_password="Cyrus admin password"
Migrating from PST files
--pst_base_folder="PST folder name"
--filename="filename containing user list"
--service_account_json_path="json file path"
--gsuite_admin="admin email address"

For details, see Migrate data from PST files.

All GSMME commands

This table details all the possible GSMME arguments.

Argument Supply this parameter
--calendar_migration_end _date

Date in YYYY-MM-DD format.

Example: --calendar_migration_end_date="2020-01-01"

Specify the end date of calendar events you want to migrate. For example, if you use 2020-01-01, events that take place after January 1, 2020 aren't migrated.

--calendar_migration _start_date

Date in YYYY-MM-DD format.

Example: --calendar_migration_start_date="2020-01-01"

Calendar events within the date range that start or have an event recurrence within the range are migrated.


Prefix to attach to label.

Example: --custom_label_prefix="migrated-"

Specify the prefix to attach to all labels.

--email_migration _end_date

Date in YYYY-MM-DD format. 

Example: --email_migration_end_date="2020-01-01"

Messages after this date are excluded from the migration.

--email_migration _start_date

Date in YYYY-MM-DD format. 

Example: --email_migration_start_date="2015-01-01"

Messages before this date are excluded from the migration.

--enable_calendar _fanout

No parameter required.

Enables calendar event fan-out for calendar migration.


No parameter required.

Enables hidden MAPI (Exchange/PST) folder migration.


No parameter required.

Enables migration from an IMAP server rather than from an Exchange server.


No parameter required.

If you enable mbox logging, GSMME writes any user messages that can't be migrated due to file size or type restrictions to a user-specific mbox file. The mbox content is located in the "mbox" folder in the GSMME trace logging folder path (for example, %localappdata%\Google\G Suite Migration\Tracing\ExchangeMigration\mbox\


No parameter required.

Enables GSMME migration from Exchange public folders to Google Groups. See Migrate public folders with GSMME for details. 

Note: You can't run a migration for both users and public folders at the same time.

--enable_resource _migration

No parameter required.

Enables calendar resource migration.


The login name for the Exchange server administrator account.

Example: --exchange_admin_login="administrator"

Use this argument in conjunction with:

If you use this argument, don't use --exchange_profile_name


The name of an existing Outlook profile you want to use to connect to your Exchange Server.

Example: --exchange_profile_name="exch_migration_admin"

Specify an administrator profile on the same machine that runs GSMME. If you use this argument, don't use:

--exclude_message_ classes

Comma-separated list of classes to exclude (no spaces between list items). 

Example: --exclude_message_classes="ipm.note.eas,ipm.note.1"

This command allows administrators to exclude messages from being migrated from Exchange to G Suite based on their message class. 

This command is useful when stubbed messages from an archiving solution need to be excluded. GSMME doesn't support the remigration of unstubbed messages. The recommended approach is to exclude stubbed messages using this command.Then, once the stubbed messages are fully rehydrated, migrate these in a second run of GSMME.


--exclude_top_level _folders

Comma-separated list of top-level folders to exclude from migration (no spaces between list items). 

Example: --exclude_top_level_folders="Deleted Items,Drafts"


Path to the CSV file of user names you want to use for this migration.

Example: --filename="C:\Documents and Settings\users.csv"

If you use this argument, don't use --migration_usernames.

--force_clear_google_ calendar_ids_on_remigration

No parameter required. 

Clears the IDs of secondary calendars before you remigrate data. When you remigrate calendar data, GSMME creates new secondary calendars with unique IDs. Doing so avoids event conflicts.

Note: Use this argument before you remigrate data. For details, go to How do I remigrate content with GSMME?


No parameter required. 

Reruns the migration on all items, rather than only on items that weren't successfully migrated.

By default, if a migration was interrupted, the next migration starts at the point where the previous migration stopped. You can use this parameter to run the migration again from the beginning.

If you use this option, duplicate email is filtered out, previously migrated calendar events are ignored (but may get duplicated in some cases), and previously migrated contacts are duplicated.


Nominated event owner for resource calendars.

Example: --gsuite_admin=""

Use this flag when performing calendar resource migrations. If an event doesn't have an owner, GSMME will set the G Suite administrator as the event owner. This user must have full access to resource calendars.

--google_domain The G Suite domain to which you are migrating data.

Example: --google_domain=""

No parameter required.

Displays a list of the arguments for ExchangeMigration.exe.


File with the complete mapping list. 

Examples: --id_mapping_file="resources.csv"

Use the CSV mapping file which contains user and/or calendar address mappings.


IMAP administrator's email address. 

Example: --imap_admin_id=""

This specifies the IMAP administrator who has access to all IMAP accounts on the server. Use this for Cyrus IMAP admin migrations.


IMAP administrator's password.

Example: --imap_admin_password="password"

Use with --imap_admin_id.



The path where user folders are stored on an IMAP server.

Example: --imap_path_prefix="INBOX"

Enter the IMAP folders' path prefix that is common to all folders. This usually is the IMAP namespace for the folder names. For example, if the IMAP folder listing for a user is:

  • INBOX.Sent
  • INBOX.Drafts

and so on, then INBOX is the path prefix. Typical values of path prefix are:

  • Groupwise IMAP, Gmail, Dovecot: none (leave the field blank)
  • Cyrus, Courier: INBOX

The port number for the IMAP server.

Example: --imap_port="143"


​The one-digit code for the security option you want to use.

Example: --imap_security="1"

Use one of the following codes:

  • 0 (no security)
  • 1 (SSL)
  • 2 (STARTTLS)

The type of IMAP server from which you are migrating data. Server types are: Exchange, GroupWise, Gmail, Cyrus, Courier, Dovecot, Zimbra, and unsupported. The default is unsupported.

Example: --imap_server_type="Gmail"

Note: If you specify an incorrect server type, the performance of the migration may be affected.


No parameter required.

When enabled, email is migrated to Google Vault. The message is uploaded to the user’s account and is marked as deleted. Google Vault retention rules determine how long the message is retained in Vault. Migrates message without creating any labels in the user’s inbox.

Note the following restrictions:

  • If you are migrating to Vault, you must have Gmail enabled. If Gmail is disabled, you will see 403 errors. 
  • Migration to VFE (Vault Former Employee) licensed users will fail (because Gmail isn't enabled to these users). 

Comma-separated list of users for migration (no spaces between items). 

Example: --migration_usernames="user1,user2,user3"

If you use this argument, don't use --filename.


No parameter required. 

Runs the migration without including calendar data.

--noenable_contact _migration

No parameter required. 

Runs the migration without including contact data.

--noenable_email _migration

No parameter required. 

Runs the migration without including email data.

--noenable_error _reports

No parameter required. 

Prevents the utility from generating migration reports, which show any message errors that occur during a migration. This can improve the performance of a migration.

For more information about migration reports, see "Reviewing migration reports" in the GSMME Admin Guide.


No parameter required. 

Runs the migration without requiring a mapping file. All mapping data is defined in the list of users by using the command  --id_mapping_file="filename".


No parameter required. 

Specifies that a prefix won't be added to labels during a migration. This applies when migrating from PST files. By default, the name of the PST file is added as a prefix to the labels and calendars created during the migration.


No parameter required. 

Runs the utility via the command line. The regular interactive (GUI) mode is the default if this isn't specified.


No parameter required. 

Closes the tool without waiting for the Enter key when the migration is run from the command line.


The number users you want to migrate at one time on the client.

Example: --num_threads="25"

A separate thread is opened for each user. If you don’t specify a value, the default is 25 threads.


Directory that contains PST files for migration. 

Example: --pst_base_folder="C:\pst"

Migrates all PST files within the subfolders of the specified folder  For detail, see "Prepare folder structure for PST migration" in the GSMME Admin Guide. If you use this argument, don't use:

--public_folder_mapping _file

Mapping file name (CSV format).

Example: --public_folder_mapping_file="public_folder_mapping.csv"

The CSV mapping file specified here maps the Exchange public folder path to the G Suite Group email address. Learn more about Migrating public folders with GSMME.


Number of retries to attempt if a temporary failure occurs (such as server busy or a timeout) before giving up.

Example: --retry_count="5"

If not specified, the default is 10.


No parameter required. 

Runs the exhaustive pre-migration diagnostics, which validates server connectivity, authentication, access to accounts, and the entire user list.

--service_account_json _path

Path to the Service Account credentials file. 

Example: --service_account_json_path ="C:\Users\admin\privatekey.json"

For instructions on obtaining this file, see Authorize GSMME for your domain


Exchange/IMAP server IP address or fully qualified domain name. 

Example: --source_server=""

In Exchange migrations, use this in conjunction with --exchange_admin_login. If you use this argument, don't use --exchange_profile_name.


No parameter required.

Specifies that messages are migrated without labels.


No parameter required.

Many administrators chose to migrate users first and calendar resources second. If you choose to migrate calendar resources second, configure GSMME to remigrate the users' calendar data. Do this by using --translate_conflicting_events.

This instructs GSMME to look at existing events already migrated to Google Calendar. It modifies these events by translating the email address of the Exchange resource to that of the matching G Suite resource.

Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.
Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue