Skip to content

Google Cloud Directory Sync Automatically on Windows

Purpose

Use GCDS to automatically synchronize user accounts

Steps

Confirm AD Users Need Synchronization

For testing purposes, confirm that there are AD users that need to be synchronized to GWS via GCDS

Confirming AD users for synchronization

Close without actual synchronization

Closing without actual synchronization

Ensure Configuration File is Properly Saved

If not saved, click Save as

Saving configuration file

Recommend saving to a unified folder

Saving to a unified folder

Skip simulation step as it has been done before

Skipping simulation step

Create Synchronization Script

Use the sync-cmd program to synchronize. Save the following script content as sync.bat

Terminal window
1
cd "C:\Program Files\Google Cloud Directory Sync\"
2
sync-cmd.exe -a -f -c "C:\gws-config\demo-config.xml" -r "C:\gws-config\sync-log.txt"

Running this will automatically synchronize GCDS

Create Synchronization Schedule

Using Windows Server as an example, open Task Scheduler and create a new task

Creating a new task in Task Scheduler

  1. Choose appropriate account
  2. Select “Run whether user is logged on or not”
  3. Run with highest privileges

Configuring task settings

Create trigger conditions

Creating trigger conditions

Add startup script, need to add ” double quotes

Adding startup script with quotation marks

After creation, wait for the trigger to see the synchronization status

Waiting for trigger and viewing sync status

You can also view the log simultaneously

Viewing synchronization logs

FAQ

Schedule Launch Failure

Check if permissions are sufficient, including execution folder and user permissions

Checking permissions for execution

User account needs Full Control permissions in the folder

Ensuring Full Control permissions for user account

Schedule Execution Has No Effect

Trigger Settings

Cannot be set to infinite, but can be set to ten years

Setting trigger duration to ten years

Execution Identity and Permissions

In GCE, automatic execution using SYSTEM / Administrator identity fails, but testing with your own user account succeeds

Testing execution with different user accounts

Failed result is 0xFF, and execution time is extremely short, about 2-3 seconds

Failed execution result and duration

Successful execution completion will indicate full completion, and execution time is about 10 seconds

Successful execution completion and duration

Synchronization Log Storage Location

Can be set in GCDS

Setting log storage location in GCDS

REF

Active Directory user account provisioning | Cloud Architecture Center | Google Cloud

G Suite tutorials - Google Cloud Directory Sync (GCDS) (youtube.com)