With the February 2016 update of the ADConnect tool, Microsoft introduced some changes in the way the scheduled sync between the on-prem AD and Azure AD works. Up until this version, the sync was controlled by a scheduled tasks, created under the root of the Windows Scheduled Tasks container. In the new versions, the scheduler is now built-in into the sync engine and controlled via the ADSync PowerShell module. Detailed information about the changes can be found in this article.
Some people have run into issues with the new model, namely in some cases the scheduler cmdlets appear to be missing. For me, this happened after I updated my lab setup to the 22.214.171.124 version. I found out about the issue few days later, after receiving the “no sync attempt registered in the past 24h” messages. Since a new version was released in the meantime, I upgraded to that one, but it didn’t seem to make a difference. After ignoring the issue for a while longer, I installed the March release as well (126.96.36.199) and since the issue was still unresolved I started investigating. Several reports for similar behavior were already submitted on different O365 communities, with no apparent fix.
So I started troubleshooting in my lab. As mentioned above, updating to the latest version didn’t seem to fix it. Neither did a clean reinstall on the AADConnect tool for that matter. Everything else seemed in order, but the Get-ADSyncScheduler cmdlet and similar were simply missing. Looking at the install logs, located under %localappdata%\AADConnect didn’t reveal anything interesting. The ADSync module was present and functioning correctly, with the exception of the scheduling cmdlets. So I went on looking at the actual module, which you can find under C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync. Inside the module file, you will find a list of files and assemblies required. Suspiciously, it lacked reference to one of the DLLs located in the \Bin directory, with name that was very suggestive: Microsoft.MetadirectoryServices.Scheduler.dll. Upon adding a reference to said file, I was finally able to use the scheduler cmdlets.
In case you want to try this solution, here are the detailed steps:
- Browse to your AADConnect install dir, should be something like: C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync
- In the ADSync folder, locate the ADSync.psd1 file and open it with your favorite text editor
- Under RequiredAssemblies, add a new line for the missing DLL. As this DLL is located under the parent directory, \Bin, make sure to prefix it with another dot: ..\Microsoft.MetadirectoryServices.Scheduler.dll
- Repeat the same for the FileList section
- Save the file and close any opened PowerShell sessions. Better yet, logoff. After logging back again, PowerShell should now recognize the AADConnect scheduler cmdlets. Hopefully 🙂