How To

Set Up DFS Namespace and Replication on Windows Server 2025

I pulled the power on a DFS file server and its client hung for 79 seconds before it found the other copy. I’d set up the DFS namespace and replication on Windows Server 2025 from scratch so I could break it on purpose. Most guides stop at the wizard, and the parts that hurt in production are the backlog, the ConflictAndDeleted folder and what happens when a member drops off the network.

Original content from computingforgeeks.com - post 180671

These are my notes from that lab. You’ll build a domain-based namespace with two folder targets, hide a folder with DFS namespace permissions and access-based enumeration, replicate it between two servers with DFS Replication, then watch a 3,000-file backlog drain, force a write conflict, recover a deleted file and kill one member mid-flight. I ran the whole thing in October 2026 on three Windows Server 2025 Datacenter VMs (build 26100.32230) in my Proxmox lab, a domain controller and two file servers, and every output below comes from those boxes.

How the namespace and replication fit together

DFS Namespaces and DFS Replication are two separate roles that people install together, and mixing them up is where most of the confusion starts. The namespace only hands out referrals. A client asks for \\lab.example.com\Files\Projects and gets told which real shares sit behind that path. Replication is what keeps those shares identical, and the namespace has no idea whether it’s running. You can have a namespace with no replication (two targets that drift apart) or replication with no namespace (two copies users reach by server name), so I set them up as two steps and test each one on its own.

The diagram shows the lab as it ended up, including the path that failed when I killed BOX2:

DFS namespace and replication architecture diagram: client gets a domain referral from DC1 10.0.1.10, a folder referral and SMB 445 from BOX1 10.0.1.21, BOX1 and BOX2 10.0.1.22 replicate over DFSR RPC

Three VMs on an isolated VLAN, all cloned from the same Windows Server 2025 template (my Proxmox Windows Server template), 2 vCPUs each:

  • DC1, 10.0.1.10: AD DS, DNS and the DFS management tools
  • BOX1, 10.0.1.21: namespace server and primary replication member
  • BOX2, 10.0.1.22: second namespace server and replication partner
  • Users alice (in the Finance group) and bob (not in it) for the permission tests

If your template was never generalized, run sysprep on each clone before you join it to the domain. Every clone of an un-sysprepped template carries the same machine SID, and a member whose SID matches the domain’s can’t join it. I sysprepped the source VM once, so each clone came up with its own SID and both file servers joined on the first try.

Preparing the domain and the two file servers

You need an Active Directory domain before anything else, because a domain-based namespace and every replication group live in AD. If you don’t have one yet, my guide to installing Active Directory on Windows Server covers it, or promote a DC with PowerShell the way I did here. On the domain controller I added the DFS management tools so I could check things from there without touching the file servers:

Install-WindowsFeature AD-Domain-Services, DNS, RSAT-DFS-Mgmt-Con -IncludeManagementTools

Once the domain is up, create the group and the two test users on the DC. The Finance share and the permission test both depend on them, and New-SmbShare fails with “No mapping between account names and security IDs was done” if the group doesn’t exist yet. Skip the users if you’ll test with real accounts, but keep the group or rename it everywhere it appears:

$pw = Read-Host 'Password for the test users' -AsSecureString
New-ADGroup -Name Finance -GroupScope Global -GroupCategory Security
New-ADUser -Name alice -SamAccountName alice -AccountPassword $pw -Enabled $true -PasswordNeverExpires $true
New-ADUser -Name bob -SamAccountName bob -AccountPassword $pw -Enabled $true -PasswordNeverExpires $true
Add-ADGroupMember -Identity Finance -Members alice

Each file server gets both roles. They’re separate features, so a server that will only hold namespace targets can skip FS-DFS-Replication, but I wanted both boxes to do both jobs. Point the server’s DNS at the domain controller first, or the domain join that follows will fail on name resolution. Get-NetAdapter gives you the interface name (mine was Ethernet):

Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.0.1.10
Install-WindowsFeature FS-DFS-Namespace, FS-DFS-Replication -IncludeManagementTools

No reboot was needed for the roles on either box. The feature result lists the file server pieces it pulled in alongside the two DFS roles:

Success       : True
RestartNeeded : No
FeatureResult : {File and iSCSI Services, DFS Namespaces, DFS Replication, File Server...}
ExitCode      : Success

Join each file server to the domain and reboot it. One thing in the event log surprised me here. BOX2’s DFS Replication service logged event 1202 a few seconds after the join, before the reboot, saying it “failed to contact domain controller to access configuration information” and would retry “during the next configuration polling cycle, which will occur in 60 minutes”. After the reboot it logged 1206 (contacted \\DC1.lab.example.com) straight away, so the error is harmless as long as you reboot after joining. Skip the reboot and the member can sit unconfigured for an hour.

$cred = Get-Credential LAB\Administrator
Add-Computer -DomainName lab.example.com -Credential $cred -Force
Restart-Computer -Force

The role install also turned on the firewall rules both roles need, so I didn’t open anything by hand. On BOX1 these rules were enabled for every profile:

  • DFS Management: TCP-In, DCOM-In, SMB-In, WMI-In
  • DFS Replication: RPC-EPMAP and RPC-In (dynamic RPC ports)

If a third-party firewall sits between the servers, it has to pass SMB on 445 plus RPC endpoint mapping on 135 and the dynamic RPC range, because replication runs over RPC rather than SMB. Open WinRM on 5985 as well if you’ll run Get-DfsrBacklog or the health report across that firewall, since both query the remote member over WinRM. My notes on opening ports in Windows Server Firewall cover the Windows side if your rules were removed by a hardening baseline.

Setting the values you’ll reuse

The domain name, the namespace path and the replication group name show up in almost every command from here on. I set them once in the PowerShell session on BOX1, where I ran the namespace and replication steps as a domain admin. Change these to match your domain and server names, and paste the block again whenever you open a new session. The LAB\ prefix in the group names further down is my domain’s NetBIOS name, so swap it for yours too:

$Domain = 'lab.example.com'
$NS     = "\\$Domain\Files"
$RG     = 'Projects-RG'
$Box1   = 'BOX1'
$Box2   = 'BOX2'

Domain Admins can create a domain namespace and a replication group by default. If you’re delegating this to a file-server team instead, they also need local Administrators on every namespace server, which is easy to forget when the AD delegation alone looks complete.

Creating the shares the namespace points at

A namespace is just pointers, so the shares have to exist on both servers before you create anything in DFS. I made three on each box: Files as the namespace root (read-only for Everyone, which is all a root needs), Projects for everyone in the domain, and Finance for the Finance group only. Run this on BOX1 and BOX2:

New-Item -ItemType Directory -Force C:\DFSRoots\Files, C:\Data\Projects, C:\Data\Finance | Out-Null
New-SmbShare -Name Files -Path C:\DFSRoots\Files -ReadAccess Everyone
New-SmbShare -Name Projects -Path C:\Data\Projects -ChangeAccess 'LAB\Domain Users' -FullAccess 'LAB\Domain Admins'
New-SmbShare -Name Finance -Path C:\Data\Finance -ChangeAccess 'LAB\Finance' -FullAccess 'LAB\Domain Admins'
icacls C:\Data\Projects /grant 'LAB\Domain Users:(OI)(CI)M'
icacls C:\Data\Finance /grant 'LAB\Finance:(OI)(CI)M'

Keep the replicated data off the system drive in production. I left it on C: because the lab VMs had one disk, but DFS Replication tracks changes through the volume’s USN journal and keeps its staging area under the replicated folder, so a busy share on C: competes with the OS for the same journal and space. It also has to be NTFS: DFS Replication does not replicate folders on ReFS or FAT. If you already run a share on Windows and want the permissions side explained, my Windows file share guide walks through share versus NTFS rights.

New-DfsnRoot: “Root target share wasn’t found”

I tested what happens if you skip the share, because the cmdlet’s help page never says the share has to exist. It does. Pointing New-DfsnRoot at a share I hadn’t created failed immediately with Windows System Error 2310, and nothing was written to AD:

New-DfsnRoot : Root target share "\\BOX1\Missing" wasn't found. Namespace root target share should exist when creating
new namespace
    + CategoryInfo          : NotSpecified: (MSFT_DFSNamespace:ROOT\Microsoft\...FT_DFSNamespace) [New-DfsnRoot],
CimException
    + FullyQualifiedErrorId : Windows System Error 2310,New-DfsnRoot

The fix is the New-SmbShare line for the root above, on every server you’ll add as a root target.

Building the DFS namespace on Windows Server 2025

Use the DomainV2 type, which the GUI calls “Windows Server 2008 mode”. It is the only domain-based type that supports access-based enumeration and more than 5,000 folders, and on a 2025 forest there is no reason to pick the older mode. I turned on access-based enumeration at creation time because the permissions test later depends on it:

New-DfsnRoot -Path $NS -TargetPath "\\$Box1\Files" -Type DomainV2 -EnableAccessBasedEnumeration $true

Add BOX2 as a second root target, so the namespace itself survives one server going away, then create the two folders. Projects gets a target on each box, Finance only lives on BOX1:

New-DfsnRootTarget -Path $NS -TargetPath "\\$Box2\Files"
New-DfsnFolder -Path "$NS\Projects" -TargetPath "\\$Box1\Projects"
New-DfsnFolderTarget -Path "$NS\Projects" -TargetPath "\\$Box2\Projects"
New-DfsnFolder -Path "$NS\Finance" -TargetPath "\\$Box1\Finance"

Did the second root target fail? It looked that way. New-DfsnRootTarget printed “The requested object could not be found.” (MI RESULT 6) and looked like a failure, yet the target had been added: BOX2 had the domainV2\Files key under HKLM\SOFTWARE\Microsoft\Dfs\Roots and the listing below shows it online. My guess is that the cmdlet reads the object back before AD has it, but I haven’t proven that, so check the targets yourself before you re-run anything:

Get-DfsnRoot -Path $NS | Format-List Path, Type, State, Flags, TimeToLiveSec
Get-DfsnRootTarget -Path $NS | Format-Table TargetPath, State, ReferralPriorityClass -AutoSize
Get-DfsnFolderTarget -Path "$NS\Projects" | Format-Table Path, TargetPath, State -AutoSize

Both root targets and both Projects targets came back online, with the 300-second referral lifetime that a new namespace gets by default:

Path          : \\lab.example.com\Files
Type          : Domain V2
State         : Online
Flags         : AccessBased Enumeration
TimeToLiveSec : 300

TargetPath                   State  ReferralPriorityClass
----------                   -----  ---------------------
\\BOX1.lab.example.com\Files Online sitecost-normal
\\BOX2.lab.example.com\Files Online sitecost-normal

Path                             TargetPath      State
----                             ----------      -----
\\lab.example.com\Files\Projects \\BOX1\Projects Online
\\lab.example.com\Files\Projects \\BOX2\Projects Online

The same check in my terminal on BOX1, which is the view I kept open for the rest of the lab:

DFS namespace root and folder targets online on BOX1 and BOX2 in Windows Server 2025

At this point the namespace works with no replication at all, which is worth knowing: a user who lands on BOX2 sees an empty Projects share until replication is set up further down.

Locking down who sees what with DFS namespace permissions

DFS namespace permissions decide who can see a folder in the namespace, not who can open it. Access-based enumeration hides a folder from anyone without Read on the namespace entry, but the actual access check still happens on the target share and its NTFS ACL. I granted the Finance group the view right on the Finance folder:

Grant-DfsnAccess -Path "$NS\Finance" -AccountName 'LAB\Finance'
dfsutil property sd "$NS\Finance"

The cmdlet reports the access type as enumerate, and dfsutil shows that the folder’s security descriptor now holds only the Finance group:

Path                            AccountName AccessType
----                            ----------- ----------
\\lab.example.com\Files\Finance LAB\Finance enumerate

\\lab.example.com\Files\Finance LAB\Finance:(RX)

Done processing this command.

To test it I mapped the namespace from DC1 as each user in turn and listed the root. The script below is what I ran, with the drive removed between users so the second login doesn’t reuse the first one’s SMB session:

foreach ($u in 'bob','alice') {
  $c = New-Object System.Management.Automation.PSCredential("LAB\$u", (Read-Host "Password for $u" -AsSecureString))
  New-PSDrive -Name N -PSProvider FileSystem -Root '\\lab.example.com\Files' -Credential $c | Out-Null
  "--- $u sees:"
  Get-ChildItem N:\ | Select-Object -ExpandProperty Name
  Remove-PSDrive N
  net use * /delete /y | Out-Null
}

Bob doesn’t see Finance at all; alice, who is in the group, sees both folders:

--- bob sees:
Projects
--- alice sees:
Finance
Projects

Then I had bob map \\lab.example.com\Files\Finance directly, the way someone would if a colleague pasted the path in a chat. The drive mapped, because the namespace still hands out the referral, and the listing failed with “Access is denied” from the BOX1 share. So the namespace permission is cosmetic and the share ACL is the lock: if you only set DFS namespace permissions and leave the target share open to Domain Users, anyone who knows the path gets in. One side effect I didn’t test: with only Finance on that folder’s descriptor, a Domain Admin who isn’t in Finance probably loses sight of it too, so run Grant-DfsnAccess for your admin group as well if that would confuse your helpdesk.

Setting up the replication group

Before replicating, I seeded the two servers with different content on purpose, because that’s the situation you’re in when you add replication to shares that already have data. BOX1 got 200 spec files and a readme.txt, and BOX2 got its own readme.txt with different text plus a box2-only.txt that existed nowhere else. Which server you mark as primary decides who wins, so make the one with the good data the primary member. To reproduce my starting point, run the first two lines on BOX1 and the last two on BOX2:

New-Item -ItemType Directory -Force C:\Data\Projects\specs | Out-Null
1..200 | ForEach-Object { Set-Content "C:\Data\Projects\specs\spec-$_.txt" ("spec $_ " + ('x' * 4000)) }; Set-Content C:\Data\Projects\readme.txt 'readme written on BOX1'
Set-Content C:\Data\Projects\readme.txt 'readme written on BOX2 before replication'
Set-Content C:\Data\Projects\box2-only.txt 'this file only existed on BOX2'

The group, the replicated folder and both members come from one pipeline. Add-DfsrConnection creates the connection in both directions unless you ask for a one-way connection:

New-DfsReplicationGroup -GroupName $RG |
  New-DfsReplicatedFolder -FolderName 'Projects' -DfsnPath "$NS\Projects" |
  Add-DfsrMember -ComputerName $Box1, $Box2
Add-DfsrConnection -GroupName $RG -SourceComputerName $Box1 -DestinationComputerName $Box2

The New-DfsReplicatedFolder step prints “WARNING: The -DfsnPath parameter is not validated. An incorrect path will not produce an error.” so check that path by eye. Next, point each member at its local folder and mark BOX1 as primary, then tell both servers to pick up the new configuration from AD now instead of on their next poll:

Set-DfsrMembership -GroupName $RG -FolderName 'Projects' -ComputerName $Box1 -ContentPath 'C:\Data\Projects' -PrimaryMember $true -Force
Set-DfsrMembership -GroupName $RG -FolderName 'Projects' -ComputerName $Box2 -ContentPath 'C:\Data\Projects' -Force
Update-DfsrConfigurationFromAD -ComputerName $Box1, $Box2

Read the membership back. The two quotas are the defaults you’ll live with unless you change them, and both are 4 GB:

Get-DfsrMembership -GroupName $RG | Format-Table ComputerName, ContentPath, PrimaryMember, StagingPathQuotaInMB, ConflictAndDeletedQuotaInMB -AutoSize

BOX1 is the only primary member:

ComputerName ContentPath      PrimaryMember StagingPathQuotaInMB ConflictAndDeletedQuotaInMB
------------ -----------      ------------- -------------------- ---------------------------
BOX1         C:\Data\Projects          True                 4096                        4096
BOX2         C:\Data\Projects         False                 4096                        4096

One default is worth checking before users move in. Get-DfsReplicatedFolder showed the file filter as {~*, *.bak, *.tmp}, which means any file whose name starts with a tilde or ends in .bak or .tmp never replicates. That covers Office lock files on purpose, but it also silently skips the .bak exports some line-of-business apps write into shared folders. Change it with Set-DfsReplicatedFolder -FileNameToExclude if your users keep real data under those names.

What initial sync did to BOX2’s own files

Initial replication of 201 files took 7 seconds from the configuration push to event 4104. The DFS Replication log on BOX2 tells the whole story in order:

  1. 1:19:21 event 1210: RPC listener up
  2. 1:19:23 event 4102 (Warning): waiting for initial replication from the primary member
  3. 1:19:24 event 4412: a file changed on multiple servers, loser moved to ConflictAndDeleted
  4. 1:19:28 event 4104: initial replication finished, local-only content moved to PreExisting

So BOX2’s readme.txt lost to BOX1’s copy and went to DfsrPrivate\ConflictAndDeleted as an UpdateConflict, and box2-only.txt vanished from the share into DfsrPrivate\PreExisting with the reason FileNotExistOnPartner. Nothing was deleted, but users on BOX2 lost a file from their view, and PreExisting is never replicated or cleaned up for you. If BOX2 had held the newer data, making BOX1 primary would have hidden all of it, which is the one decision in this guide that’s hard to walk back.

Watching the DFS replication backlog drain

The DFS replication backlog is the number of changes one member still has to send to another, and it’s the first thing to check when someone says a file “hasn’t shown up on the other server”. To give it something to chew on, I wrote 3,000 files of about 8 KB each into Projects\build on BOX1, which took 12 seconds:

New-Item -ItemType Directory -Force C:\Data\Projects\build | Out-Null
1..3000 | ForEach-Object { Set-Content "C:\Data\Projects\build\artifact-$_.log" ("line $_ " + ('y' * 8000)) }

Then I polled the backlog every few seconds. The count only appears with -Verbose; without it you get the first 100 file names as objects:

Get-DfsrBacklog -GroupName $RG -FolderName 'Projects' -SourceComputerName $Box1 -DestinationComputerName $Box2 -Verbose

Source is the sender and destination is the receiver, so this measures what BOX1 still owes BOX2. My polling loop logged these counts (trimmed from one line every 3 to 4 seconds):

01:22:30 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 2414
01:22:34 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 2783
01:23:14 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 1983
01:23:56 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 1036
01:24:28 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 526
01:24:56 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 59
01:24:59 The replicated folder has a backlog of files. Replicated folder: "Projects". Count: 1
01:25:04 No backlog for the replicated folder named "Projects"
drained at 01:25:04, elapsed 166 s

The count climbed for a few seconds after the writes finished (2,414 to 2,783), probably because the service was still picking them up from the journal, then fell at roughly 18 files a second between two VMs on the same host. So when is a backlog a problem? One that shrinks is fine, even if it is large. The one to worry about is a backlog that stays flat or keeps growing across several checks, because that means the connection isn’t moving anything, and the event log on the receiving member is where the reason will be. Also, each Get-DfsrBacklog call took 3 to 4 seconds in my lab, so don’t put it in a tight monitoring loop across dozens of connections.

The old dfsrdiag tool still ships with the management tools on Server 2025 and gives the same number with the first 100 names, which is handy in a cmd window or an old monitoring script. I caught this one while replication from BOX1 to BOX2 was suspended with 250 new files waiting:

dfsrdiag backlog /rgname:Projects-RG /rfname:Projects /smem:BOX1 /rmem:BOX2

It counts the new folder as well as the files, which is why it says 251 for 250 files:

Member <box2> Backlog File Count: 251
Backlog File Names (first 100 files)
     1. C:\Data\Projects\reports
     2. C:\Data\Projects\reports\q4-1.csv
     3. C:\Data\Projects\reports\q4-2.csv

Operation Succeeded

For a fuller picture, Write-DfsrHealthReport writes an HTML and XML report per group into the folder you give it:

New-Item -ItemType Directory -Force C:\lab\report | Out-Null
Write-DfsrHealthReport -GroupName $RG -ReferenceComputerName $Box1 -MemberComputerName $Box1, $Box2 -Path C:\lab\report

Mine took 17 seconds for two members. It flagged BOX2 with “Pre-existing content is not replicated and is consuming disk space”, which is the PreExisting folder from initial sync. Both servers also got “The DFS Replication service is restarting frequently” because they had restarted three times that day during setup. The HTML relies on old Internet Explorer scripting. In Chromium most of its sections came up blank for me, so read the XML file if your browser does the same.

Forcing a conflict and reading ConflictAndDeleted

DFS Replication resolves a conflict by keeping the most recent write and moving the other version into the losing member’s DfsrPrivate\ConflictAndDeleted folder. I wanted to see the losing edit with my own eyes, so I created plan.txt on BOX1, let it replicate, then suspended replication in both directions and edited the file on each server:

Suspend-DfsReplicationGroup -GroupName $RG -SourceComputerName $Box1 -DestinationComputerName $Box2 -DurationInMinutes 5
Suspend-DfsReplicationGroup -GroupName $RG -SourceComputerName $Box2 -DestinationComputerName $Box1 -DurationInMinutes 5

I appended “edit made on BOX1 first” on BOX1 at 01:26:23 and “edit made on BOX2 second” on BOX2 at 01:27:14, then resumed both directions. Sync-DfsReplicationGroup overrides the suspension for the number of minutes you give it, and -DurationInMinutes is required:

Sync-DfsReplicationGroup -GroupName $RG -SourceComputerName $Box1 -DestinationComputerName $Box2 -DurationInMinutes 5
Sync-DfsReplicationGroup -GroupName $RG -SourceComputerName $Box2 -DestinationComputerName $Box1 -DurationInMinutes 5

DFS Replication logged the conflict (event 4412) at 01:27:15, one second after the BOX2 edit, and when I read the file a minute later both servers held the BOX2 version with BOX1’s line gone. The preserved copy is listed with:

Get-DfsrPreservedFiles -Path C:\Data\Projects\DfsrPrivate\ConflictAndDeletedManifest.xml

Each entry carries the original path, the name it was saved under and why. On BOX1 the losing edit looked like this:

Path            : \\.\C:\Data\Projects\plan.txt
Uid             : {4DC5E494-61CD-4492-A8EA-4A148C50FB4D}-v3214
Gvsn            : {4DC5E494-61CD-4492-A8EA-4A148C50FB4D}-v3215
MemberGuid      : 71f750da-362f-4747-9c32-726cda285b11
Attributes      : Archive
PreservedName   : plan-{4DC5E494-61CD-4492-A8EA-4A148C50FB4D}-v3215.txt
PreservedTime   : 10/31/2026 1:27:15 AM
PreservedReason : UpdateConflict
FileCount       : 1
FileSize        : 45

Deletes go to the same place, which is the part people miss. I deleted specs\spec-7.txt on BOX1, and on BOX2 the manifest gained an entry with PreservedReason : FileDelete. So “who deleted the quarterly report” is usually answered by the ConflictAndDeleted folder on the other server, as long as the 4 GB quota hasn’t pushed the file out. Microsoft treats that folder as a cache with no guarantees, so it’s a convenience, not a backup.

Restoring from ConflictAndDeleted without overwriting the winners

My first restore attempt hung. I ran Restore-DfsrPreservedFiles -RestoreToOrigin -CopyFiles on BOX2 inside Invoke-Command to bring back the deleted spec, and it sat there forever. Running the same thing with -WhatIf showed why: it wanted to confirm overwriting live files, because restore-to-origin replays every entry in the manifest, not just the one you’re after:

What if: Performing the operation "Restore-DfsrPreservedFiles" on target "Are you sure you want to overwrite "C:\Data\Projects\readme.txt" with "C:\Data\Projects\DfsrPrivate\ConflictAndDeleted\readme-{94C62549-F10E-4BF0-8CF8-F3CBF15FA83D}-v11.txt"?".
What if: Performing the operation "Restore-DfsrPreservedFiles" on target "Are you sure you want to overwrite "C:\Data\Projects\plan.txt" with "C:\Data\Projects\DfsrPrivate\ConflictAndDeleted\plan-{4DC5E494-61CD-4492-A8EA-4A148C50FB4D}-v3215.txt"?".

Had I added -Force to that original command, BOX2 would have put back the old readme and the losing edit of plan.txt over the current versions, and replication would then have spread both to BOX1. What worked safely was restoring everything to a scratch folder and copying back only the file I wanted. Run it on BOX2, the server whose manifest holds the deleted file:

Restore-DfsrPreservedFiles -Path C:\Data\Projects\DfsrPrivate\ConflictAndDeletedManifest.xml -RestoreToPath C:\Restore -CopyFiles -Force
Copy-Item C:\Restore\Data\Projects\specs\spec-7.txt C:\Data\Projects\specs\

-CopyFiles matters too, because without it the cmdlet moves the preserved files out of ConflictAndDeleted and you lose the safety copy. The restored spec replicated back to BOX1, and the readme and plan files on both servers stayed as they were.

Pulling the plug on a member

This is the test I cared most about: what clients and replication do when a file server dies without warning. I hard-stopped BOX2 twice, the equivalent of pulling its power cable. The first run gave me the replication numbers, but my timer on the client got cut off, so I powered BOX2 back on and repeated the client half with the timing in place. DC1 played the client in both runs, logged on as alice. To make sure it was actually using BOX2, I raised BOX2’s referral priority for Projects on BOX1:

Set-DfsnFolderTarget -Path "$NS\Projects" -TargetPath "\\$Box2\Projects" -ReferralPriorityClass GlobalHigh

On the client, I flushed the referral cache, mapped the folder as alice and timed it. This is the block I ran before the second stop, and again after it without the first line, each time in a fresh PowerShell window:

dfsutil cache referral flush
$c = Get-Credential LAB\alice
$t = Measure-Command { New-PSDrive -Name P -PSProvider FileSystem -Root '\\lab.example.com\Files\Projects' -Credential $c | Out-Null }
"New-PSDrive took $([math]::Round($t.TotalSeconds,2)) s"
$t = Measure-Command { $n = (Get-ChildItem P:\specs).Count }
"listed $n files in $([math]::Round($t.TotalSeconds,2)) s"
dfsutil cache referral
Remove-PSDrive P

Before the stop, the mapping took 0.15 seconds and dfsutil cache referral showed \BOX2\Projects as the ACTIVE target. For the second run I left the cache alone after the stop, so the client still held that referral when I mapped the folder again. The mapping took 79.08 seconds. Once it returned, listing 200 files took 0.03 seconds, because by then the client had marked BOX2 unreachable (0xc00000be, bad network path) and moved to BOX1:

dfsutil cache referral showing BOX2 unreachable and BOX1 active after a DFS member went offline

So DFS namespace failover works, but it isn’t instant for a client that already holds a referral to the dead server: it has to give up on the dead server before it tries the next target. Users see that as Explorer hanging for over a minute. If you need faster failover than that for a share, DFS is the wrong tool and a failover cluster file server is the right one.

Replication behaved differently. During the first outage I wrote 500 files on BOX1, and Get-DfsrBacklog did not report a large backlog. It spent 48 seconds trying to reach BOX2 and then failed, because it asks the receiving member for its state over WinRM:

Get-DfsrBacklog : Could not retrieve the backlog information. Replication group: "Projects-RG" Replicated folder:
"Projects" Source computer: BOX1 Destination computer: BOX2 Confirm that you are running in an elevated Windows
PowerShell session and are a member of the local Administrators group on the destination computer. The destination
computer must also be accessible over the network, and have the DFSR service running. This cmdlet does not support WMI
calls for the following or earlier operating systems: Windows Server 2012. Details: WinRM cannot complete the
operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that
a firewall exception for the WinRM service is enabled and allows access from this computer.

Meanwhile Get-DfsrConnection still listed both connections as Enabled and Normal. A monitoring script that only checks connection state would have reported a healthy group with a dead member, so alert on the backlog query failing, not just on the count.

Get-DfsrBacklog: “No replicated folders were found on the member”

When BOX2 came back after the first outage, the backlog query went through three stages, and the middle one looks alarming. First the WinRM error again, while Windows was still booting. Then, for about 15 seconds, “No replicated folders were found on the member. Member name: BOX2” even though nothing had changed in the configuration. Then a normal count of 501, which dropped to zero in 33 seconds. The middle error is the DFS Replication service checking its database after the unclean shutdown, and BOX2’s log showed exactly that:

  • 1:43:31 event 2212 (Warning): unexpected shutdown detected on volume C:
  • 1:43:35 event 2218: second step of database consistency checks
  • 1:43:55 event 2214: recovered from the unexpected shutdown

The recovery took 24 seconds on a folder with about 3,700 files and needed nothing from me. Don’t remove and re-add the member when you see that error right after a crash; wait for 2214 in the DFS Replication log, then query the backlog again.

What I still don’t know

A two-server lab on one Proxmox host answers the mechanics but leaves some of the production questions open. These are the ones I couldn’t settle, and I’d test them before rolling DFS out across offices:

  • Whether the 79-second client stall changes across two AD sites with site costing on
  • How fast the backlog drains over a real WAN link with remote differential compression doing its job
  • Why New-DfsnRootTarget reported “The requested object could not be found.” for a target it created
  • What three or more members do to conflict handling when two of them edit the same file

The 18 files a second I measured came from two VMs sharing one host’s storage, so treat it as a ceiling for small files rather than a planning number. Microsoft’s DFS Replication overview lists the supported limits and the parts DFS Replication won’t touch, such as EFS-encrypted files, and it’s worth reading before you point it at a share that matters. If I were doing this again for a real office, I’d move the replicated folders to a data volume, pick the primary member by checking which server has the newest files rather than by name, and alert on a failing backlog query instead of a large count.

Keep reading

Create a Bootable Windows 11 USB and Install Windows 11 Windows Create a Bootable Windows 11 USB and Install Windows 11 Set Up a Samba Share on Windows 11 and Access It from Linux Networking Set Up a Samba Share on Windows 11 and Access It from Linux Windows 11 Installation on KVM with Virt-Manager KVM Windows 11 Installation on KVM with Virt-Manager Install Grok Build on Windows 11 (Formerly Cursor) AI Install Grok Build on Windows 11 (Formerly Cursor) netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) Cheat Sheets netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) Enable Hyper-V and Install Vagrant on Windows 11/10 Virtualization Enable Hyper-V and Install Vagrant on Windows 11/10

Leave a Comment

Press ESC to close