Dirsync errors nad solutions: Event ID 0: Invalid namespace while automatic Sync or Start-OnlineCoexistenceSync, Object not found on the server

I have been facing errors with one of my customers lately. There is hybrid deployment with Exchange on premise and Office 365 with ADFS.


  • Dirsync stopped to work, because automatic synchronization started to throw invalid namespace errors (Event ID 0)
  • DirSync cannot be run via Start-OnlineCoexistenceSync
  • Dirsync could run manually from GUI

invalid namespace


When DirSync is installed on the server, after its configuration DirSync installator creates a service, which by default run synchronization every 3 hours to populate changes of local AD´s objects to the cloud and if Hybrid deplouyment checkbox is ticked during configuration, it also updates few attributes in opposite direction (From Cloud -> On premise).

Behind the scenes this service also creates performance counters to WMI and this is also the problem! In my case CCM agent´s (installed by SCCM) old version has been uninstalled and during uninstallation of CCM agent the repository of WMI has been corrupted. This caused the FIM Synchronization service to fail to run.


The solution is not easy and here are the steps need to be run in the following order to make it work and make it work permanenty:

  • Fix MOF files – MOF files are used to register performance counters to WMI. These files can be registered once per product installation or everytime the product upgrades and this is problem. Dirsync Product has by default MOF files, which are registered only once and not during upgrades. This problems come up when CCM agent is uninstalled and MOF files are not re-registered. To prevent this to happen again add the following text to the first line of MOF files for dirsync product:

MOF file location:
%Program Files%\Windows Azure Active Directory Sync\SYNCBUS\Synchronization Service\Bin

MOF files name:

mmswmi-x.mof is used for product uninstallation. Do not change it.

//*                                                      *
//*   Copyright (C) Microsoft. All rights reserved.      *
//*                                                      *
// mmswmi.MOF

  • Repair WMI repository permanently

To repair WMI you must run the following command from the same location as previous step and restart FIM Synchronization service. The result should be “Done!”

mofcomp mmswmi.mof
  • Re-Register FIM Sync Service DLL and restart win management service

From the same location under elevated permissions run:

regsvr32 /s mmswmi.dll
net stop winmgmt
net start winmgmt
  • Re-Run configuration of DirSync

From the location %Program Files%\Windows Azure Active Directory Sync run ConfigWizard.exe

If you receive the following error, move service accounts (MSOL* to OU=Users in root domain of your Onpremise AD)

No object on server

ADFS / Office 365 / Exchange 2010 – How to force synchronization – Event ID:0, Event ID:1, Event ID:3, Event ID:4, Event ID:6126, Event ID:6127

I have created new admin account to manage Exchange 2010 SP3 / Office 365 hybrid deployment using ADFS (advanced SSO config). By default it takes up to 3 hours to sync newly created / added accounts to Office 365. To force synchronization perform:

  1. Logon to DirSync server
  2. Open Powershell module: Microsoft Online Services Module for Windows PowerShell
  3. Or you can use remote powershell if WinRM has been konfigured by running:
    Invoke-Command -ScriptBlock {Add-PSSnapin Coexistence-Configuration;Start-onlinecoexistencesync} –ComputerName <DIRSYNC server name>
  4. Run command for immediate AD synchronization:

After running command you can check Event log if all is OK.

  1. Open application Event log and check for the following events:
  2. Event ID: 0 – Connecting to MS Online and starting Synchronization
  3. Event ID: 6127 – The management agent “SourceAD” completed run profile “Delta Import Delta Sync” with a delta import or delta synchronization step type. The rules configuration has changed since the last full synchronization
  4. Event OS: 6126 – The management agent “TargetWebService” completed run profile “Delta Confirming Import” with a delta import or delta synchronization step type. The rules configuration has changed since the last full import or full synchronization.
  5. Event ID: 1 – Import to Dirsync started
  6. Event ID: 2 – Import to Dirsync completed
  7. Event ID: 3 – Export to Office 365 started
  8. Event ID: 4 – Export to Office 365 completed



Default Sync interval can be changed here:

C:\program files\Microsoft Online Directory Sync\Microsoft.Online.DirSync.Scheduler.exe.Config

To run online coexistence sync for new versions of DirSync run:

Import-Module DirSync

Default path: C:\Program Files\Windows Azure Active Directory Sync\dirsync