Synchronize using the command line

You can use the sync-cmd command and Google Cloud Directory Sync (GCDS) to run synchronizations from the command line.

When to sync from the command line

When you set up or modify your configuration, you should run a manual synchronization from Configuration Manager. Doing so allows you to check the synchronized data and make sure it's in order. For details, go to Perform a manual synchronization.

After you’re done making configuration changes, you can automate your sync process using the command line. You can incorporate synchronizations into any scheduling or batch script you wish to use. Alternatively, you can use a third-party tool to automate syncs. For details, go to Schedule automatic synchronizations.

Use the command line

You run the sync-cmd command from the GCDS installation directory and enter the command on a single line. You can use the command arguments listed below to perform a range of actions, such as:

  • Apply any detected changes.
  • Read a specified file.
  • Set the logging detail level.

Tip: You can get information about the available command arguments by entering sync-cmd -h.

Command arguments & examples

Expand all  |  Collapse all & go to top

Review exit code

After you run your sync or simulation from the command line, you get one of the following exit codes:

  • 0—Sync completed without any sync issues and all modifications do not exceed the configured limits.
  • 255—Simulation completed. Or, sync completed and there are sync issues, such as modifications that exceeded the configured limits or a user failed to sync.

Next step

You should monitor all synchronizations by checking for any notification messages on a regular basis. For details, go to Set your notifications.


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?
10178035211157042041
true
Search
Clear search
Close search
Main menu
Search Help Center
true
true
true
true
true
73010
false
false
false