Is there a way to monitor the DFSR backlog in a manner more efficient than using dfsrdiag.exe backlog?

I wrote a program that just slurps in the backlog count via dfsrdiag.exe backlog /smem:alpha /rmem:beta /rgname:domain\namespace\foldername /rfname:foldername with five minute intervals. Each time it runs, it takes quite a while (between 2 to 5 minutes) to get the resulting value. That means that in the end, it runs for a few minutes to collect the info and then delays for five minutes. It feels like it is probably expensive in some fashion in order to get this info. It also returns the top 100 files in the backlog. I really only want the backlog count alone and don't care about the files themselves. This is being used to create historical graphs.

Info for these DFSR peers: Windows 2008 R2 on four servers, three distant offices connected via 50-100Mb Internet connections, 30 replication groups, several replication groups are very large in file total size (1-2TB each) though most are small (500MB-10GB).

  • Are you seeing a significant increase in resource utilization while your program collects data? You seem to be asking for a fix to something you aren't sure is broke.
    – HostBits
    May 23 '12 at 2:14
  • I reworded the question. I want to know if there is a way to do it more efficient than using dfsrdiag itself. May 23 '12 at 3:10

There is another way to get at the information, and that's through WMI. An enterprising soul has put together a PowerShell script that gathers this information:


No indication of whether or not is faster than dfsrdiag, but I suspect it just might be.

The WMI root is root\MicrosoftDFS and from there you can do the queries via Get-WmiObject

  • This answer was very useful and it looks like it'll get me exactly what I want. The important part is that local access is pretty much instantaneous. To actually get the resulting backlog value, it looks like you need values from both servers. For my need, I would fetch those values from multiple servers many times and can do the calculations in my code instead of needing dfsrdiag to fetch the same values over and over again for each pairing combination. That should save tons of processing time alone. Plus the peers can communicate their values via an external communication channel I choose. May 23 '12 at 8:56

Here's a pure PowerShell way to do it:

$RegEx=[System.Text.RegularExpressions.Regex]::new("Count: (\d+)$")
$DFSRMembers=Get-DfsrMembership | Where-Object { $_.Enabled } | Where-Object { $_.GroupName -eq "<namespace>" }
if ($DFSRMembers.Count -gt 1) {
  for ($i=0; $i -lt $DFSRMembers.Count; $i++) {
    $OtherMembers=$DFSRMembers | Where-Object { ($_.ComputerName -ne $DFSRMembers[$i].ComputerName) -and ($_.FolderName -eq $DFSRMembers[$i].FolderName) }
    if ($OtherMembers.Count -ne 0) {
      for ($j=0; $j -lt $OtherMembers.Count; $j++) {
        $BackLog=($($Junk=.{Get-DfsrBacklog -GroupName $DFSRMembers[$i].GroupName -FolderName $DFSRMembers[$i].FolderName -SourceComputerName $DFSRMembers[$i].ComputerName -DestinationComputerName $OtherMembers[$j].ComputerName -Verbose}) 4>&1).Message
        if ($Matches -ne $null) { $BackLog=[System.Convert]::ToInt32($RegEx.Matches($backlog).Groups[1].Value) } else { $BackLog=0 }
        $DFSObject=New-Object -Type PSObject -Property @{Group=$DFSRMembers[$i].GroupName;Folder=$DFSRMembers[$i].FolderName;From=$DFSRMembers[$i].ComputerName;To=$OtherMembers[$j].ComputerName;Backlog=$BackLog}
$DFSObjects | Sort-Object -Property BackLog -Descending | Format-Table -Property Group,Folder,From,To,Backlog
  • Slogmeister, What version of PS are you using? I'm getting a few errors with the code. Thanks
    – John T
    Jan 29 at 23:24
  • @JohnT PowerShell 5.1 on Windows 10 (20H2) in the same domain as the DFS server. I corrected the script above as I had hardcoded a namespace. Feb 1 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.