File services: DFS namespace, replication, FSRM and shadow copies
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Users shouldn’t have to care which server holds a share. A DFS namespace gives them one path, like \\saatlab.internal\Files, and that path keeps working while you add, move or replace the servers behind it.
You’ll build that namespace and replicate a Policies folder between two servers with DFS Replication. Then you’ll set a quota and block executable files with FSRM, and bring back a deleted file from shadow copies.
| Time | You need | By the end you can |
|---|---|---|
| About 90 minutes | DC01, DC02, SRV01 and CL01, with the shares from Lesson 16 | Create a domain-based DFS namespace, set up DFS Replication, use FSRM quotas and file screens, and restore files from shadow copies |
What it is, in one line
A DFS namespace is a virtual folder tree published under your domain name, and each of its folders points to real shares on one or more servers.
In Simple Words
The company switchboard number
Customers ring one company number, and the switchboard behind it routes each call to whichever desk is handling that department today, so when a team moves floors the public number stays the same. A DFS namespace is that switchboard number for files: people always open \\saatlab.internal\Files\Policies and DFS quietly sends them to a server that has the folder. DFS Replication is like giving two desks identical copies of the same handbook and keeping them in sync, so either desk can answer.
Engineer's View
Namespaces, replication, FSRM and VSS
DFS Namespaces (DFSN): a domain-based namespace (DomainV2) is stored in AD, so its path uses the domain name and it can be hosted on several namespace servers. Each folder has one or more targets. A client asks for a referral, gets back a list of targets sorted by site, caches it, and moves on to the next target if one stops answering.
DFS Replication (DFSR): multi-master replication of folder contents between the members of a replication group. It sends only the blocks that changed (remote differential compression) and keeps a staging area. If the same file changes in two places before they sync, the last writer wins and the losing copy goes to DfsrPrivate\ConflictAndDeleted.
FSRM: File Server Resource Manager gives you per-folder quotas (hard or soft), file screens that block file types, storage reports and file classification. Shadow copies (VSS) are point-in-time snapshots of a volume that users can open as Previous Versions, and Data Deduplication stores repeated chunks once, which works well for file shares and backup volumes.
Remember that none of these is a backup. Replication copies deletions as well, and shadow copies sit on the same server. Real backup comes in Lesson 38.
How it works, step by step
This is what happens when CL01 opens \\saatlab.internal\Files\Policies:
The client only talks to the namespace server to get the referral. From then on it connects directly to a file server and keeps the referral cached for a while, so the namespace server never becomes a bottleneck.
Here’s the file service layout you’ll build:
- Install DFS Namespaces, DFS Replication and FSRM on SRV01, and DFS Replication on DC02.
- Create the namespace
\\saatlab.internal\Fileswith a Departments folder. - Replicate a Policies folder between SRV01 and DC02, and publish it with two targets.
- Limit Priya’s home folder with a quota, and block executables in Departments.
- Protect drive D with shadow copies and restore a deleted file.
DC02 is the second replication member here only because the lab is short on memory. At work, DFS Replication runs between file servers, not DCs.
Hands-on Lab: DFS namespace and file services on SRV01
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01, SRV01 and DC02, and work on SRV01 as SAATLAB\Administrator in PowerShell as administrator. CL01 comes in at step 5, once you’ve shut down DC02.
1Install the file services
On SRV01, run this:
Install-WindowsFeature FS-DFS-Namespace, FS-DFS-Replication, FS-Resource-Manager -IncludeManagementTools
Install-WindowsFeature FS-DFS-Replication -ComputerName DC02You should see something like this:
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {DFS Namespaces, DFS Replication, File Server Resource Manager, ...}
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {DFS Replication}✅ Checkpoint: Both installs report Success.
2Create the namespace
On SRV01, create the root folder and its share, then the namespace and its first folder:
New-Item -ItemType Directory D:\DFSRoots\Files | Out-Null
New-SmbShare -Name Files -Path D:\DFSRoots\Files -ReadAccess 'NT AUTHORITY\Authenticated Users' | Out-Null
New-DfsnRoot -Path \\saatlab.internal\Files -TargetPath \\SRV01\Files -Type DomainV2
New-DfsnFolder -Path \\saatlab.internal\Files\Departments -TargetPath \\SRV01\Departments
Get-DfsnFolderTarget -Path \\saatlab.internal\Files\Departments | Select-Object Path, TargetPath, StateYou should see something like this:
Path TargetPath State
---- ---------- -----
\\saatlab.internal\Files\Departments \\SRV01\Departments OnlineThe root share only needs Read, because users never store files in the root. They pass through it to the folder targets, and the permissions from Lesson 16 still apply there.
✅ Checkpoint: The Departments folder in the namespace points to \\SRV01\Departments and is Online.
3Replicate a Policies folder between SRV01 and DC02
On SRV01, create the folders and a first file, then the replication group:
New-Item -ItemType Directory D:\Policies | Out-Null
'Staff handbook v1' | Set-Content D:\Policies\handbook.txt
Invoke-Command -ComputerName DC02 -ScriptBlock { New-Item -ItemType Directory C:\Policies | Out-Null }
New-DfsReplicationGroup -GroupName Policies | Out-Null
New-DfsReplicatedFolder -GroupName Policies -FolderName Policies | Out-Null
Add-DfsrMember -GroupName Policies -ComputerName SRV01, DC02 | Out-Null
Add-DfsrConnection -GroupName Policies -SourceComputerName SRV01 -DestinationComputerName DC02 | Out-Null
Set-DfsrMembership -GroupName Policies -FolderName Policies -ComputerName SRV01 -ContentPath D:\Policies -PrimaryMember $true -Force | Out-Null
Set-DfsrMembership -GroupName Policies -FolderName Policies -ComputerName DC02 -ContentPath C:\Policies -Force | Out-Null
Update-DfsrConfigurationFromAD -ComputerName SRV01, DC02During the first sync the primary member’s copy wins, so SRV01, which has the real data, is set as primary. Update-DfsrConfigurationFromAD makes both servers pick up the new settings straight away rather than at their next AD poll.
Give it two or three minutes, then check that DC02 got the file:
Get-Content \\DC02\C$\Policies\handbook.txt
Get-WinEvent -ComputerName DC02 -LogName 'DFS Replication' -MaxEvents 5 | Select-Object Id, MessageYou should see something like this:
Staff handbook v1
Id Message
-- -------
4104 The DFS Replication service successfully finished initial replication on the replicated folder at local path C:\Policies...
4102 The DFS Replication service initialized the replicated folder at local path C:\Policies and is waiting to perform initial...Share both copies and publish them in the namespace as two targets of the same folder:
New-SmbShare -Name Policies -Path D:\Policies -ReadAccess 'NT AUTHORITY\Authenticated Users' -FullAccess 'SAATLAB\Domain Admins' | Out-Null
Invoke-Command -ComputerName DC02 -ScriptBlock { New-SmbShare -Name Policies -Path C:\Policies -ReadAccess 'NT AUTHORITY\Authenticated Users' -FullAccess 'SAATLAB\Domain Admins' | Out-Null }
New-DfsnFolder -Path \\saatlab.internal\Files\Policies -TargetPath \\SRV01\Policies | Out-Null
New-DfsnFolderTarget -Path \\saatlab.internal\Files\Policies -TargetPath \\DC02\Policies | Out-Null
Get-DfsnFolderTarget -Path \\saatlab.internal\Files\Policies | Select-Object TargetPath, StateYou should see something like this:
TargetPath State
---------- -----
\\SRV01\Policies Online
\\DC02\Policies Online✅ Checkpoint: handbook.txt exists on DC02, event 4104 appeared, and the Policies folder has two Online targets.

4Set a quota and block executable files with FSRM
On SRV01, run this:
New-FsrmQuota -Path D:\Home\priya.sharma -Size 100MB -Description 'Lab home folder limit' | Out-Null
New-FsrmFileScreen -Path D:\Shares -IncludeGroup 'Executable Files' -Active -Description 'No programs in department shares' | Out-Null
Get-FsrmQuota | Select-Object Path, @{n='LimitMB';e={$_.Size/1MB}}, @{n='UsedMB';e={[math]::Round($_.Usage/1MB,2)}}, SoftLimit
Get-FsrmFileScreen | Select-Object Path, Active, IncludeGroupYou should see something like this:
Path LimitMB UsedMB SoftLimit
---- ------- ------ ---------
D:\Home\priya.sharma 100 0 False
Path Active IncludeGroup
---- ------ ------------
D:\Shares True {Executable Files}SoftLimit False means a hard quota, so writes past 100 MB are refused; a soft quota only warns and reports. The file screen is active, which means FSRM won’t save files that match the “Executable Files” group (.exe, .bat, .ps1 and more) anywhere under D:\Shares.
✅ Checkpoint: Priya’s folder has a 100 MB hard quota, and D:\Shares has an active file screen.
5Turn on shadow copies and restore a deleted file
On SRV01, give drive D some shadow copy storage and take a first copy:
vssadmin add shadowstorage /for=D: /on=D: /maxsize=10%
vssadmin create shadow /for=D:You should see something like this:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.
Successfully added the shadow copy storage association
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.
Successfully created shadow copy for 'D:\'
Shadow Copy ID: {5d3c2a1e-8b7f-4c6d-9e0a-1f2b3c4d5e6f}
Shadow Copy Volume Name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1In File Explorer on SRV01, right-click drive D, pick Configure Shadow Copies, select D and click Settings, Schedule. You’ll see the default schedule of twice a day (7:00 and 12:00 on weekdays). Click Enable to turn it on.
Now shut down DC02 and start CL01. Sign in as SAATLAB\priya.sharma, open \\saatlab.internal\Files\Departments\Finance in File Explorer and delete budget.txt.
Right-click an empty spot in the Finance folder, choose Properties and go to the Previous Versions tab. Pick the version from a few minutes ago, click Open and copy budget.txt back into Finance.
✅ Checkpoint: Priya restored budget.txt herself from Previous Versions, through the DFS path.
When you’re done, take snapshots of all four VMs called “File services”.
'DC01','DC02','SRV01','CL01' | ForEach-Object { VBoxManage snapshot $_ take "File services" } Break It, Then Fix It
File services have two classic surprises: a full quota that looks exactly like a full disk, and two people editing the same replicated file.
1Break it: hit the quota
On SRV01, try creating a 150 MB file in Priya’s home folder:
fsutil file createnew D:\Home\priya.sharma\big.bin 157286400You’ll get an error like this:
Error: There is not enough space on the disk.Drive D still has nearly 20 GB free, yet Windows tells you the disk is full. That’s because a hard quota reports itself to applications in the same way a full disk does, which confuses users and admins alike. FSRM also writes event 12325 to the Application log when a hard limit is hit.
Look at the quota, then fix it by raising the limit (or by cleaning up):
Get-FsrmQuota -Path D:\Home\priya.sharma | Select-Object Path, @{n='LimitMB';e={$_.Size/1MB}}
Set-FsrmQuota -Path D:\Home\priya.sharma -Size 200MB
fsutil file createnew D:\Home\priya.sharma\big.bin 157286400
Remove-Item D:\Home\priya.sharma\big.binYou should see something like this:
Path LimitMB
---- -------
D:\Home\priya.sharma 100
File D:\Home\priya.sharma\big.bin is created✅ Checkpoint: The file failed with a 100 MB quota and was created after raising it to 200 MB.
2Break it: the same file changed on both servers
Start DC02 again (CL01 can be shut down). Pause replication in both directions so the two copies can drift apart:
On SRV01, run this:
Add-DfsrConnection -GroupName Policies -SourceComputerName DC02 -DestinationComputerName SRV01 -ErrorAction SilentlyContinue | Out-Null
Suspend-DfsReplicationGroup -GroupName Policies -SourceComputerName SRV01 -DestinationComputerName DC02 -DurationInMinutes 10
Suspend-DfsReplicationGroup -GroupName Policies -SourceComputerName DC02 -DestinationComputerName SRV01 -DurationInMinutes 10
'Handbook v2: edited on SRV01' | Set-Content D:\Policies\handbook.txt
Start-Sleep -Seconds 5
Invoke-Command -ComputerName DC02 -ScriptBlock { 'Handbook v2: edited on DC02' | Set-Content C:\Policies\handbook.txt }
Sync-DfsReplicationGroup -GroupName Policies -SourceComputerName SRV01 -DestinationComputerName DC02 -DurationInMinutes 5
Sync-DfsReplicationGroup -GroupName Policies -SourceComputerName DC02 -DestinationComputerName SRV01 -DurationInMinutes 5After a minute, compare the two copies:
Get-Content D:\Policies\handbook.txt
Get-Content \\DC02\C$\Policies\handbook.txt
Get-ChildItem -Force D:\Policies\DfsrPrivate\ConflictAndDeleted | Select-Object NameYou’ll see something like this:
Handbook v2: edited on DC02
Handbook v2: edited on DC02
Name
----
handbook-{8F1C2D3E-4A5B-4C6D-8E7F-9A0B1C2D3E4F}-v1234.txtDC02’s edit was saved last, so it won on both servers. SRV01’s edit isn’t completely gone, because DFSR moved it to the ConflictAndDeleted folder and logged event 4412. The trouble is that nobody gets told, and that folder gets trimmed once it reaches its size limit.
To fix it, recover the losing version and then decide which content is correct:
Get-DfsrPreservedFiles -Path D:\Policies\DfsrPrivate\ConflictAndDeletedManifest.xml | Select-Object PreservedName, OriginalPath
Restore-DfsrPreservedFiles -Path D:\Policies\DfsrPrivate\ConflictAndDeletedManifest.xml -RestoreToPath C:\Restored -CopyFilesThe proper fix is in the design. DFS Replication works well for content that’s edited in one place and read in many, like policies and software. For files people edit at two sites at the same time, use a single active target in the namespace, or a collaboration tool that locks files.
✅ Checkpoint: One edit won on both servers, and you found and restored the other from ConflictAndDeleted.

This happened at work
“It’s fine, it’s replicated”
A company had two offices, with DFS Replication keeping their project folders identical. The IT manager liked to say they didn’t need much backup because “everything exists in two places”. Then one Friday evening a project lead was tidying her folders and deleted the top-level folder of a finished project by mistake, three years of drawings. Within a minute DFS Replication had deleted it in the second office too. The ConflictAndDeleted folder had a 4 GB limit, far smaller than the project, so most of it was gone from there as well.
Shadow copies existed on only one server and were five days old, the rest came back from a monthly tape, and the team ended up redrawing two weeks of work. The fix: proper daily backups of one replication member with 30-day retention, shadow copies on both servers and a bigger ConflictAndDeleted quota. Someone also wrote “Replication” and “backup” on the whiteboard as two different words.
The lesson: replication protects you when a server fails, but it does nothing when a person deletes something. Only a backup with history saves you from mistakes.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| Treating DFS Replication as backup | Deletions and ransomware replicate too | Back up at least one member, with history |
| Same files edited at two sites | Last writer wins; the other edit goes to ConflictAndDeleted | One active target for collaborative data |
| “There is not enough space on the disk” while the volume has room | An FSRM hard quota was hit | Check Get-FsrmQuota and event 12325 |
| Namespace on one server only | The path breaks if that server is down | Add a second namespace server |
| Initial replication with the wrong primary member | Empty or old data overwrites the good copy | Mark the server with the real data as primary |
| Staging quota too small | Replication slows down and logs staging warnings | Size staging for the largest files |
| Shadow copies on the same volume as busy data | Old copies are deleted when space runs out | Give them enough space or a separate volume |
| File screens blocking legitimate scripts | IT can’t store tools in shares | Use exceptions on specific folders |
| Users given the server path instead of the DFS path | Moves and replacements break their shortcuts | Always publish the namespace path |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. Can you explain in simple words what a DFS namespace is and why users like it?
Why they ask this: They want to check you understand the idea behind DFS namespaces and don’t only know the feature’s name.
How you might answer: A DFS namespace is a virtual folder tree under one path, like \\domain\Files. Each folder in it points to a real share on one or more servers.
Users like it because the path stays the same even when we move data to a new server.
2. People often mix up DFS Namespaces and DFS Replication. What’s the difference?
Why they ask this: They want to see that you can separate the two features, because they solve different problems.
How you might answer: Namespaces give users one path and send them to a target share, while Replication keeps folder contents in sync between servers. They often work together, but either one can be used on its own.
3. A user deleted an important file from a share this morning. How can they get it back without calling you?
Why they ask this: They want to know if you understand shadow copies and how they save time for users and the helpdesk.
How you might answer: If shadow copies are on for that volume, the user opens the folder’s Properties, goes to Previous Versions, picks an earlier version and copies the file back.
2–5 years experience
4. A folder in DFS has targets in two offices. How does a user’s PC decide which server to go to?
Why they ask this: They want to check that you understand referrals, which explains why users sometimes land on the wrong server.
How you might answer: The client gets a referral from a namespace server listing the targets in order of AD site cost. It uses the first one and moves to the next if that stops answering. Referrals are cached, so a change doesn’t always show up straight away.
5. Two people edit the same file on two DFSR servers at the same time. What happens to their changes?
Why they ask this: They want to see that you understand DFSR conflicts and know how to get the losing copy back.
How you might answer: The most recent change wins. The other copy is moved to the ConflictAndDeleted folder and event 4412 is logged, and if someone needs the older copy I can bring it back with Restore-DfsrPreservedFiles.
6. Have you used File Server Resource Manager? Tell me what you would use it for on a file server.
Why they ask this: They want to know if you have hands-on experience with FSRM and know its main features.
How you might answer: Yes, mainly for hard and soft quotas and for file screens that block certain file types. It also gives you storage reports, and it can classify files and run actions like moving expired files somewhere else.
Senior level
7. Your company has three offices and one central data center. How would you design file services for them?
Why they ask this: They want to see that you think about sites, user experience and data safety together.
How you might answer: I’d use a domain namespace with namespace servers in each site and folder targets for each office. Read-mostly data would go on DFSR hub-and-spoke with backups taken at the hub, and for data people edit together I’d keep a single active target to avoid conflicts. Every file server gets FSRM and shadow copies.
8. It’s Monday morning and the DFS Replication backlog keeps growing. Where would you look?
Why they ask this: They want to know if you have a clear set of tools and checks for DFSR problems.
How you might answer: I’d measure the backlog first with Get-DfsrBacklog or dfsrdiag backlog, then read the DFSR event log for staging problems, journal wrap or a dirty shutdown. After that I’d look at bandwidth schedules, the staging quota, AD replication of the DFSR configuration, antivirus exclusions and disk performance.
9. Management is worried about ransomware hitting the file shares. How would you protect them?
Why they ask this: They want to see that you think in layers, and that you know backups only count if restores are tested.
How you might answer: I’d start with least-privilege NTFS permissions and FSRM file screens for known ransomware extensions, frequent shadow copies, and immutable or offline backups. I’d also watch for mass file changes, use Defender with controlled folder access where it fits, and make sure we test restores regularly.
Quick quiz
Q1. What does a DFS namespace give users?
- Faster disks
- One path that doesn’t change when servers do
- Automatic backups
Show answer
B — Folders point to real shares behind the scenes.
Q2. Which server’s data wins during initial DFS Replication?
- The newest server
- The primary member
- The one with the most files
Show answer
B — Mark the server with the real data as primary.
Q3. What did fsutil say when the quota was hit?
- Access is denied
- There is not enough space on the disk
- Quota exceeded
Show answer
B — Hard quotas look like a full disk to applications.
Q4. Where does DFSR put the losing copy of a conflict?
- The Recycle Bin
- DfsrPrivate\ConflictAndDeleted
- Nowhere
Show answer
B — Restore it with Restore-DfsrPreservedFiles.
Q5. In the work story, why was the project lost from both offices?
- A disk failed
- Replication copied the deletion
- The namespace was down
Show answer
B — Replication is not backup.
Quick recap
- A DFS namespace such as
\\saatlab.internal\Filesgives users one path to shares on any server. - Folders can have several targets; clients get referrals and fail over.
- DFS Replication keeps folders in sync; the last writer wins and losers go to ConflictAndDeleted.
- FSRM adds quotas and file screens; a hard quota looks like a full disk.
- Shadow copies let users restore files from Previous Versions.
- None of this is a backup.
Next lesson
Lesson 18: Print server → You’ll install the Print Server role on SRV01, add a printer with the right driver, share and publish it in AD, deploy it to users, and fix a stuck print queue.
Further reading: DFS namespace
Want to go deeper into DFS namespace? Microsoft’s DFS Namespaces overview and DFS Replication overview explain both features in depth. You can also see the full plan for this course on the Windows Server Administration course page.
