Perform a synchronization using the command line
Google Apps Directory Sync (GADS) uses the sync-cmd command to run synchronizations. You can incorporate synchronizations into any scheduling or batch script you wish to use. Run without any arguments, this command returns an error and directs you to run sync-cmd -h for help.
Use the sync-cmd [argument] -c file-name command to perform a range of actions such as:
- Read a specified file.
- Check to be sure that a synchronizations is not already running.
- Generate a list of changes.
- Apply any changes.
When you enter the sync-cmd [argument] -c file-name command, replace file-name with the name of the XML file that you created using Configuration Manager. You can use any of the arguments listed below.
sync-cmd -h command in the directory where GADS is installed.| Argument | Description |
|---|---|
-a,--apply |
Specifies to apply any detected changes. Note: If you do not use this tag, a synchronization is run as a test only, and no changes are made to your Google Apps account. For the best results, run a test synchronization without this argument before running a full synchronization with it. |
-c,--config file name |
Specifies the configuration file to load. Synchronization will not occur without a valid XML file specified with this argument. |
-d, --deletelimits |
Specifies to ignore any configured delete limits. |
-f, --flush |
Resolves specific troubleshooting issues. Improper use can cause performance degradation. Do not use this option unless directed to do so by support.
|
-g, --groups |
Specifies to not analyze groups. Use this option if you want to synchronize users, but not groups. |
-h,--help |
Displays help information and exits. |
-l,--loglevel value |
Specifies to override the default or configured log level with a specified value. Valid values (in increasing order of detail) are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. In most cases, the recommended log level is INFO. |
-lic,--license |
Specifies to not analyze licenses. Use this option if you don’t want to synchronize license data for users. |
-o,--oneinstance |
Restricts the running synchronizations to one instance per configuration file. Only valid with -a. |
-ou, --orgunit |
Specifies to not analyze organizational units. |
-r,--report-out |
Writes reports to a specified output file, in addition to writing them to the log. |
-s, --sharedcontacts |
Specifies to not analyze shared contacts. |
-u, --users |
Specifies to not analyze users. Use this option if you want to synchronize groups, but not users. |
-v |
Displays short application-version information. |
-V |
Displays detailed application-version information, but does not synchronize it. |
Example 1: Run a sync simulation using the XML configuration file C:\Users\user\gads-config.xml:
sync-cmd -c C:\Users\user\gads-config.xml
Example 2: Run a full sync, including applying changes, using the XML configuration file C:\Users\user\gads-config.xml:
sync-cmd -a -c C:\Users\user\gads-config.xml

