Pre-requisites:
Before proceeding, please ensure the following are in place:
GCDS is installed on your Windows Server
A GCDS configuration file (.xml) has been created and successfully tested
Admin credentials are configured within GCDS
Step 1: Locate The Gcds Sync Command:
GCDS uses a command-line tool called sync-cmd, located by default at:
C:\Program Files\Google Cloud Directory Sync\sync-cmd.exe
The sync command you will use in Task Scheduler is:
"C:\Program Files\Google Cloud Directory Sync\sync-cmd.exe" -a -c "C:\Path\To\Your\config.xml"
Flag Reference:
-a → Applies changes (without this flag, the tool runs in dry-run/test mode only)
-c → Specifies the path to your GCDS configuration file
Step 2: Open Task Scheduler
Press Win + R, type taskschd.msc, and press Enter.
OR
Navigate to Start → Administrative Tools → Task Scheduler.
Step 3: Create A New Task
In the right-hand panel, click "Create Task" (use this option, NOT "Create Basic Task", as it provides full configuration control).
The Create Task window will open with multiple tabs.
Step 4: General Tab — Configure Task Identity
Name: GCDS Daily Sync
Description: Syncs Active Directory users to Google Workspace daily
Run as user: Service account or admin with GCDS permissions (click "Change User or Group" to set this)
Select: "Run whether user is logged on or not"
Check: "Run with highest privileges"
Configure for: Your Windows Server version
Step 5: Triggers Tab — Set The Daily Schedule
Click the Triggers tab → Click "New".
Configure the following settings:
Begin the task: On a schedule
Settings: Daily
Start date: Today's date
Recur every: 1 day
Start time: Your preferred time (recommended: off-peak hours, e.g., 11:00 PM)
Enabled: Checked
Click OK.
Note: Scheduling during off-peak hours (late night) is strongly recommended to avoid any impact on users during business hours.
Step 6: Actions Tab — Set The Sync Command
Click the Actions tab → Click "New".
Configure the following:
Action: Start a program
Program/script: "C:\Program Files\Google Cloud Directory Sync\sync-cmd.exe"
Add arguments: -a -c "C:\GCDS\config.xml"
Start in (optional): C:\Program Files\Google Cloud Directory Sync\
Click OK.
Step 7: Conditions Tab
tart only if computer is on AC power: Uncheck (not applicable for servers)
Wake computer to run this task: Check (optional but recommended)
Start only if network is available: Check
Step 8: Settings Tab
Allow task to run on demand: Checked
Run task as soon as possible after a scheduled start is missed: Checked
Stop the task if it runs longer than: 1 hour (adjust based on your directory size)
If the task is already running: Do not start a new instance
Step 9: Save The Task
Click OK.
Enter the password for the user account configured in the General tab.
Click OK — your task is now saved and scheduled.
Step 10: Test The Task Manually
In the Task Scheduler, locate the GCDS Daily Sync task.
Right-click → Select "Run".
Check the "Last Run Result" column — a value of 0x0 indicates success.
Log in to your Google Admin Console → Directory → Users to verify that users have synced correctly.
Step 11: Enable Logging (Recommended)
To capture sync logs for auditing and troubleshooting, update your action arguments as follows:
-a -c "C:\GCDS\config.xml" > "C:\GCDS\Logs\sync-log.txt" 2>&1
Alternatively, you can configure GCDS's built-in logging directly within the configuration file.
Verify Sync In Google Admin Console
Go to admin.google.com
Navigate to Directory → Users
Confirm that new or updated Active Directory users appear after the scheduled run.
Common Troubleshooting Reference
Task runs but no sync occurs → Remove the -a flag first to run in dry-run/test mode and review the logs. (Important and Check check the logs, accordingly take action)
Access denied error → Ensure the run-as account has local admin rights and GCDS permissions.
Config file not found → Use the full absolute path and enclose it in quotation marks.
OAuth/authentication errors → Re-authorize GCDS credentials and re-save the configuration file.
Task does not trigger → Check if the service account password has expired or the account is locked.