So up until the latest version of the DirSync tool (at the time of this writing version 6862.0000), in order to force a sync, we first had launch a Windows Powershell 2.0 console on the respective server and then navigate to “C:\Program Files\Microsoft Online Directory Sync” or “C:\Program Files\Windows Azure Directory Sync” folder (depending on version in use) and from here run the “DirSyncConfigshell.psc1” script followed by running the actual “Start-OnlineCoexistenceSync” cmdlet that initiates the sync itself.
With version 6862.0000, we still use the “Start-OnlineCoexistenceSync” cmdlet to initiate the actual sync. However, in order to run this cmdlet, instead of executing the “DirSyncConfigshell.psc1” script, we must use one of the following methods:
Method 1
Open Windows PowerShell and use the “Import-Modules.ps1” script which is located in the “DirSync” sub-folder.
Method 2
Open Windows PowerShell and then run “Import-Module Dirsync”.
A small but nonetheless important change to be aware of. Especially if you have and identity management solution that includes logic that force a sync after a new user has been provisioned/updated/etc.
Thanks to Brian Reid for the tip about method 2!
Until later,
Henrik Walther
I have the same problem yesterday….
To force a synchronization DirSync version (1.0.6862.0000)
1. Run PowerShell console as Administrator
2. Change folder to C:Program FilesWindows Azure Active Directory Sync
3. Type Import-Module DirSync
4. Run Start-OnlineCoexistenceSync
I found a more precise step by step instruction here: http://www.grishbi.com/2014/08/missing-start-onlinecoexistencesync-running-dirsync-via-powershell/
I was facing a similar trouble, and was able to resolve this via http://www.grishbi.com/2014/08/missing-start-onlinecoexistencesync-running-dirsync-via-powershell/
It's baffling that MS removed the Powershell module and just gave us a commandline tool. Hello automation and scripting?!
I was unable to make Powershell that calls the DirectorySyncClientCmd.exe work, when executed via webservice hosted on IIS. Instead, I solved it by using the TaskScheduler library found here: http://taskscheduler.codeplex.com . This allows you to start the "Azure AD Sync Scheduler" scheduled task on the server you installed the Azure admin tools on. Here's a code example in C#:
using (TaskService service = new TaskService("addirsyncservername", "username", "domain", "password"))
{
Microsoft.Win32.TaskScheduler.Task task = service.GetTask("Azure AD Sync Scheduler");
task.Run();
while (task.State == TaskState.Running)
{
Thread.Sleep(1000);
}
}
I want to put the following commands in a .bat or vb script. Can someone help with that?
To force a synchronization DirSync version (1.0.6862.0000)
1. Run PowerShell console as Administrator
2. Change folder to C:Program FilesWindows Azure Active Directory Sync
3. Type Import-Module DirSync
4. Run Start-OnlineCoexistenceSync