[Reference] How to execute initial or delta sync via command-line


Overview

If you un-check the box in the configuration wizard to prevent the initial synchronization from happening, you can fire the initial synchronization using DirectorySyncClientCMD.Exe.

File:

  • DirectorySyncClientCmd.Exe

Location:

  • %programfiles%\Microsoft Azure AD Sync\Bin
  • %programfiles%\Microsoft Azure AD Connection Tool

Arguments

    • Initial – (DirectorySyncClientCMD Initial)
      • This will run through the steps to execute the initial synchronization to the cloud.
      • Executes the following:
    • Full Import (Stage Only) on all connectors
    • Delta Import (Stage Only) on all connectors
    • Delta Synchronizaiton on all AD connectors
    • Export, Delta Import and Delta Synchronization on WAAD Connector
    • Export on all AD Connectors
    • Delta – (DirectorySyncClientCMD Delta)
      • This will run through the steps to execute a delta synchronization to the cloud
      • Executes the following:
        • Delta Import (Stage Only) on all connectors
        • Delta Synchronization on all AD connectors
        • Export, Delta Import and Delta Synchronization on WAAD Connector
        • Export on all AD Connectors

Comments (9)

  1. Anonymous says:

    Run the following :
    DirectorySyncClientCmd.exe initial

  2. Anonymous says:

    If AADsync is using OU filtering and OUs are added or removed, is an initial or delta synchronization required? In DirSync, changes such as OUs would required a full import/full sync.

  3. How to force full sync if required

  4. Parkerthon says:

    Would love to know why the initial switch only appears to work once and then afterwards only runs a delta even when the parameter is specified. Any time a change is made to OU selection or scope filters a full sync is necessary.

  5. Interactive Search Marketing says:

    This is an excellent article! If you have a business, search engine optimization is a must. Find out how we can help you by visiting our website: interactivesearchmarketing.com

  6. mikie says:

    Is there a way to have the fine grain control you do via Synchronization Service Manager using the command line?
    IE: pick a one connector and run a specific profile.

  7. TomMorris says:

    why can I not run this from a remote PSSession?
    Server A has the AADConnect Files and Services and I’m trying to run the Command from within a PSScript on Server B

  8. alex says:

    Hi TomMorris, how do you run the command remotely from the PShell script? I have a script that does the same thing and I use . In the script block I first CD to C:Program FilesMicrosoft Azure AD SyncBin, and only then I run ".DirectorySyncClientCmd.exe
    delta" command to initiate the delta sync.
    As an example this is how I implemented the PShell cmdlet:
    Invoke-Command -ComputerName AADSyncMachine.fqdn -ScriptBlock {cd "C:Program FilesMicrosoft Azure AD SyncBin"; .DirectorySyncClientCmd.exe delta} -Credentials (Get-Credentials)

  9. Marcus says:

    Hi, may I know what will happen if in the Task Scheduler, it shows that only DirectorySyncClientCmd.exe is specified without any argument ?