Windows – DFSR-related WMI info is missing

windowswindows-server-2012wmi

OS: Server 2012 Core and Server 2012 R2 Core.
DFS-Replication is installed and appears healthy.

I am using WMI to collect information from DFSR replication members. The queries work on many of the computers, but there are a couple of replication members on which the queries do not work.

It is the DfsrReplicatedFolderInfo class from the root\MicrosoftDFS namespace.

If I execute the following Powershell command:

Get-WmiObject -Namespace 'root\MicrosoftDFS' -Class DfsrReplicatedFolderInfo

The result is null. No error, but absolutely no output.

If I execute the following corresponding wmic command:

wmic /namespace:\\root\microsoftdfs path DfsrReplicatedFolderInfo get

it returns:

No Instance(s) Available.

This happens regardless of whether the commands are executed locally or remotely.

winmgmt /verifyrepository returns:

WMI repository is consistent

Using wbemtest, I am able to view the DfsrReplicatedFolderInfo class definition, but there appear to be no instances of it.

Other DFSR-related classes in the same namespace appear to be working correctly.

Best Answer

Problem solved. DFSR was in fact not healthy. It was not a WMI problem. The server had experienced a dirty shutdown, and DFSR stopped replicating because of it.

Restarting replication on the affected volume with

wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="DC8EEE19-97E2-4E26-8AAD-CF1235B8DCCC" call ResumeReplication

Resolved the issue.

Then I turned auto recovery back on by editing the registry:

HKLM\System\CurrentControlSet\Services\DFSR\Parameters\
       StopReplicationOnAutoRecovery = 0

So that this wouldn't happen again in the future.

I'm really embarrassed for not checking the logs more thoroughly in the first place.