Skip to content

Instantly share code, notes, and snippets.

@heyseus1
Created April 25, 2019 23:18
Show Gist options
  • Save heyseus1/9bc2e49c6db694a738938d503a19bc11 to your computer and use it in GitHub Desktop.
Save heyseus1/9bc2e49c6db694a738938d503a19bc11 to your computer and use it in GitHub Desktop.
script to run google cloud directory sync in windows
$msbuild = "C:\Program Files\Google Apps Directory Sync\sync-cmd.exe"
$arguments = "-a -o -c config.xml"
while ($true) {
start-Process -FilePath $msbuild $arguments
Start-Sleep -Seconds 600
}
<#
-a,--apply
Specifies to apply any detected changes.
Note: If you don't use this tag, a synchronization is run as a test only, and no changes are made to your Google domain.
For the best results, run a test synchronization without this argument before running a full synchronization with it.
-c,--config file-name
Specifies the XML configuration file to load.
Important: Synchronization won't occur without a valid XML file specified with this argument.
-o,--oneinstance
Restricts the running synchronizations to one instance per configuration file. Only valid with -a.
This limits GCDS to a single instance per XML configuration file, which prevents multiple instances from running inadvertently (for example, through a scheduler or cron job).
config.xml references a file with all GCDS configurations located at C:\Program Files\Google Apps Directory Sync\config.xml
#>
@alanyip2007
Copy link

I am doing expect the same but the logs returns oauth failed error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment