Skip to main content

DFS & WMI

By November 18, 2013November 13th, 2020Blog, Hot Technology Topics, Microsoft

While working on a DFS implementation recently I noticed that DFS Replication wasn’t working.

My first step was to generate a Diagnostic Report, which can be found in the Actions Pane of DFS Management, when a replication group is selected. The report very helpfully told me two things. First, my destination server was still awaiting initial replication. Second, DFS couldn’t access the WMI repository on the source server.

Specifically: Due to the following error, the DFS Replication reporting mechanism cannot access the WMI (Windows Management Instrumentation) namespace to retrieve certain reporting information. Error ID: 0x80041002.

A quick Google told me that 0x80041002 translated to “WBEM_E_NOT_FOUND” which was less than helpful, but caused me to suspect that there were larger issues with the WMI repository. I ran the WMI Diagnosis Utility and my suspicions were confirmed: the WMI repository was corrupt.

I tried the recommended steps for repairing the repository to no avail, so I manually rebuilt the WMI repository:

  1. Change startup type to Window Management Instrumentation (WMI) Service to disabled
  2. Stop the WMI Service; you may need to stop IP Helper Service first or other dependent services before it allows you to stop WMI Service
  3. Rename the repository folder: C:WINDOWSsystem32wbemRepository to Repository.old
  4. Open a CMD Prompt with elevated privileges
  5. CD windowssystem32wbem
  6. for /f %%s in (‘dir /b /s *.dll’) do regsvr32 /s %%s
  7. Set the WMI Service type back to Automatic and start WMI Service
  8. cd /d c: ((go to the root of the c drive, this is important))
  9. for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s
  10. Reboot the server

I then re-created my DFS Replication groups. Happily, ‘dfsrdiag replicationstate’ showed pending transactions, and it was only a matter of time before the initial sync was completed.

Shane Skriletz, PEI

 

2 Comments

  • Charles Terry says:

    I’m having trouble with the for stmt in lines 6 and 9

    • Ian Yates says:

      The double percent (%%) is needed when running from within a batch file
      If typing manually on a command line just use a single percent (%) instead.

      for /f %s ….
      rather than
      for /f %%s …

Leave a Reply