I am facing a very weird issue with DFS-R. Recently I had to recreate two Replication Groups (Data Collection) in order to restore file replication after a disaster with one of the servers. Everything went well during the whole process and both servers are already in sync with each other. However, when I run a WMI query (Wmic /namespace:\root\microsoftdfs path dfsrreplicatedfolderinfo get replicationgroupname, replicatedfoldername, state) to see the status of the Replication Groups, I see duplicate values for a given RG with a status of '0' (Uninitialized).
I have already checked everything I could... If I open the DFS Management console I don't see any duplicate Replication Groups there; the contents of the XML configuration files under "C:\System Volume Information\DFSR" & "E:\System Volume Information\DFSR" - being the latter one where the replicated data resides - are OK (no duplicate entries); and on registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\DFSR), I also only see what's really configured (again, no duplicate values).
I strongly suspect it's some sort of left over on the WMI repository that was not handled properly by DFS-R when the Replication Groups were re-created, but as I've never had to delete spefic instances from WMI, I am wondering whether someone out there has already faced the same issue or has any clues on how to get rid of these disturbing duplicate results being returned on "Wmic /namespace:\root\microsoftdfs path dfsrreplicatedfolderinfo get replicationgroupname,replicatedfoldername,state".
Just wanted to emphasize that replication is working fine between the two boxes (in both directions), the only issue being faced here is the duplicate thing.
I managed to figure out what was wrong by myself. As it turns out, those duplicate entries being returned upon "Wmic /namespace:\root\microsoftdfs path dfsrreplicatedfolderinfo get replicationgroupname,replicatedfoldername,state" were due to leftovers in the folder dedicated to the Staging area. When the Replication Groups were recreated, the contents of the Staging folder were not manually deleted and DFS-R didn’t manage to handle that very well. In order to resolve it, I created a new folder for Staging, pointed the DFS Replication Group within DFS Management Console to the new folder, gave it over 12 hours (I was really precautious here due to the size and criticality of the data in scope) to ensure DFS-R had fully recognized the new configuration, stopped DFS Replication service, deleted the old Staging folder and, finally, restarted DFS Replication service. Now everything is back on track and looking good. :-)