rss logo

Setting Up DFS with Replication

Intro

Microsoft Logo

Here we'll look at how to install and configure a complete DFS architecture. I'll keep it simple, as I'll only be using two DFS servers, but more can be added to improve redundancy or if you have remote sites.

The aim here is to provide high availability for network shares.

In the event of failure of one of the two servers, the second will seamlessly take over.

Note: Failover clustering (not covered here) can also be used for high availability file sharing. DFS is more suitable when servers are located at several remote sites, as it better handles 'slow' connections.

Network diagram

Animation illustrating DFS replication setup between two Windows Servers (SRV01 and SRV02) with network shares accessed from a Windows 10 client in the std.local domain.

Installing DFS roles (SRV01 and SRV02)

We need to install the DFS roles on both servers, either via the GUI or PowerShell.

PowerShell

  • Install the replication and namespace roles in a single PowerShell command:
PS C:\Users\administrator.STD> Install-WindowsFeature "FS-DFS-Namespace","FS-DFS-Replication" -IncludeManagementTools

GUI

  • In the Server Manager dashboard, click Manage > Add Roles and Features:
Screenshot of Server Manager in Windows with the Manage menu open and the 'Add Roles and Features' option highlighted.
  • Select Role-based or feature-based installation:
Screenshot of the Add Roles and Features Wizard with 'Role-based or feature-based installation' selected and the 'Next' button highlighted.
  • Select local server:
Screenshot of the Add Roles and Features Wizard with 'Select a server from the server pool' chosen and the 'Next' button highlighted.
  • Select the DFS Namespace and DFS Replication roles:
Screenshot of the Add Roles and Features Wizard with 'DFS Namespaces' and 'DFS Replication' selected under Server Roles and the 'Next' button highlighted.
  • No Feature, click Next:
Screenshot of the Add Roles and Features Wizard with the 'Next' button highlighted on the Select Features page.
  • Check the Restart destination server and click on Install:
Screenshot of the Add Roles and Features Wizard with the 'Restart the destination server automatically if required' checkbox selected and the 'Install' button highlighted on the Confirmation page.

The DFS Namespace

  • Open the DFS Management console («dfsmgmt.msc»):
Screenshot of the Windows Run dialog box with dfsmgmt.msc command entered and the OK button highlighted.

Create a Namespace

  • In the DFS Management console, right-click on Namespaces and select New Namespace…:
Screenshot of DFS Management with the Namespaces section selected and the 'New Namespace' option highlighted.
  • Click on Browse:
Screenshot of the New Namespace Wizard with an arrow pointing to the 'Browse' button for selecting the namespace server.
  • Search and select the first server:
Screenshot of the New Namespace Wizard with an arrow pointing to the 'Browse' button for selecting the namespace server.
  • Click on Next:
Screenshot of the New Namespace Wizard with 'srv01' entered as the server and the 'Next' button highlighted.
  • Enter a name for the Namespace:
Screenshot of the New Namespace Wizard with 'share' entered as the namespace name and the 'Next' button highlighted.
  • Leave the default value and click Next:
Screenshot of the New Namespace Wizard with 'Domain-based namespace' selected and the 'Next' button highlighted.
  • Click on Create:
Screenshot of the New Namespace Wizard showing the review settings and the 'Create' button highlighted to finalize the namespace creation.
  • Click on Close:
Screenshot of the New Namespace Wizard showing the confirmation page with the 'Close' button highlighted after successful namespace creation.
  • Your new namespace shoud appear:
Screenshot of DFS Management showing the configured namespace \\std.local\share with referral status enabled.

Adding a Namespace Server

We now need to add our SRV02 as a namespace server.

  • In the DFS management console, right-click on Namespaces and select Add Namespace Server…:
Screenshot of DFS Management with the context menu open and the 'Add Namespace Server' option highlighted for the namespace \\std.local\share.
  • Click on Browse:
Screenshot of the Add Namespace Server dialog box with an arrow pointing to the 'Browse' button for selecting a namespace server.
  • Search and select the second server:
Screenshot of the Select Computer dialog box with 'SRV02' entered and the OK button highlighted.
  • Click OK to add second server:
Screenshot of the Add Namespace Server dialog box with 'SRV02' entered as the namespace server and the OK button highlighted.
  • You should now see your two servers as namespace server:
Screenshot of DFS Management showing the namespace \\std.local\share with both SRV01 and SRV02 paths listed and referral status enabled.

Create the Folder Targets

  • In the DFS Management console, right-click on your namespace and select New Folder…:
Screenshot of DFS Management with the context menu open and the 'New Folder' option highlighted for the namespace \\std.local\share.
  • Give your folder a name and click on Add…:
Screenshot of the New Folder dialog box in DFS Management with 'Common' entered as the folder name and the 'Add' button highlighted.
  • Click on Browse:
Screenshot of the Add Folder Target dialog box with an arrow pointing to the 'Browse' button to select the path to the folder target.
  • Click on New Shared Folder…:
Screenshot of the Browse for Shared Folders dialog box with an arrow pointing to the 'New Shared Folder' button.
  • Click on Browse…:
Screenshot of the Create Share dialog box with an arrow pointing to the 'Browse' button for selecting the local path of the shared folder.
  • Select a folder and click on OK:
Screenshot of the Browse For Folder dialog box with 'Common' selected and the OK button highlighted.
  • Give your share a name and click OK, three times:
Screenshot of the Create Share dialog box with 'Common' entered as the share name and the OK button highlighted. Screenshot of the Browse for Shared Folders dialog box with 'Common' selected and the OK button highlighted. Screenshot of the Add Folder Target dialog box with the path '\\SRV01\Common' entered and the OK button highlighted.
  • Repeat the same procedure to create the SRV02 folder:
Screenshot of the New Folder dialog box in DFS Management with the folder target '\\SRV01\Common' listed and the Add button highlighted.
  • Once both Folder targets have been configured, click OK:
Screenshot of the New Folder dialog box in DFS Management with folder targets '\\SRV01\Common' and '\\SRV02\Common' listed and the OK button highlighted.
  • A prompt window appears, asking you to configure replication automatically, as we will do manually, click No:
Screenshot of a prompt asking if you want to create a replication group, with the No button highlighted.
  • You should now see your Folder targets:
Screenshot of DFS Management showing the Common folder with folder targets \\SRV01\Common and \\SRV02\Common, both with referral status enabled.
  • You should now be able to access your share via Namespace:
Screenshot of the file explorer showing the \\std.local\share directory with the Common folder inside.

Share Permissions

  • If you try to create a file from your namespace, you should see a Destination Folder Access Denied window:
Screenshot of the file explorer showing an access denied message when trying to open the \\std.local\share\Common folder.

The reason is that, by default, we only have read access. Let's see how to change this.

  • In the DFS Management Console, right-click on the SRV01 entry and click on Properties:
Screenshot of DFS Management showing the context menu for the folder target \\SRV01\Common with the Properties option highlighted.
  • In the General tab, click on Share Permissions…:
Screenshot of the Properties dialog box for \\SRV01\Common with an arrow pointing to the Share Permissions button.
  • Check the boxes to add Permissions rights for everyone, then click OK:
Screenshot of the Permissions for Common dialog box with 'Change' permission checked for Everyone and the OK button highlighted.

Do the same for the SRV02 entrie.

  • You should now be able to create Files:
Screenshot of the file explorer showing the \\std.local\share\Common directory with a New Text Document created inside.
  • If we have created files on our nameshare, we can see that they are only present on one of our two servers:
Screenshot showing file explorer windows for \\srv01\Common with text documents and \\srv02\Common which is currently empty, highlighting the need for synchronization.

This is quite normal, as we now need to configure DFS replication so that we have the same files on both our servers. We'll look at this in the next chapter.

DFS Replication

As you can see from this diagram, DFS Replication will synchronize our two Common local folders on our servers.

Diagram showing DFS replication setup between SRV01 and SRV02 with namespace root \\std.local\share and folder targets synchronized.
  • In the DFS Management console, right-click on Replication and select New Replication Group…:
Screenshot of DFS Management with an arrow highlighting the option to create a New Replication Group.
  • Select Multipurpose replication group and click Next:
Screenshot of the New Replication Group Wizard showing the selection of the Multipurpose replication group option.
  • Define replication name:
Screenshot of the New Replication Group Wizard showing the setup of the name and domain for the replication group named Common_Rep.
  • In the Replication Group Members section, click on Add…:
Screenshot of the New Replication Group Wizard displaying the option to add servers as members to the replication group.
  • Add the name of our two servers name and click on OK:
Screenshot of the Select Computers window where SRV01 and SRV02 are chosen as objects, with an OK button highlighted for confirmation.
  • Then click on Next:
Screenshot of the New Replication Group Wizard showing SRV01 and SRV02 added as members with the Next button highlighted.
  • Select Full mesh and click Next:
Screenshot of the Topology Selection step in the New Replication Group Wizard, showing the Full Mesh option selected, where all members replicate with each other, suitable for replication groups with ten or fewer members.
  • In Replication Group Schedule and Bandwidth, select an appropriate bandwidth based on the link speed between the two servers. As they are on the same LAN in my test architecture, I chose Full Bandwidth:
Screenshot of the Replication Group Schedule and Bandwidth step in the New Replication Group Wizard, highlighting the option to replicate continuously using the specified bandwidth, set to Full for 24/7 replication.
  • Choose the primary server from which we want to replicate to the other members:
Screenshot of the Primary Member step in the New Replication Group Wizard, showing the selection of the primary member server named SRV01, which will be authoritative for the initial replication.
  • We now need to specify the folders to be replicated. In our case, these are the two shared folders in D:\Common on our two servers:
Screenshot of the Folders to Replicate step in the New Replication Group Wizard, displaying the option to add folders for replication with the Add button highlighted.
  • Click on Browse:
Screenshot of the Add Folder to Replicate dialog in the New Replication Group Wizard, with the Browse button highlighted to select the local path of the folder to replicate.
  • Select the Common folder:
Screenshot of the Browse For Folder window within the Add Folder to Replicate dialog, showing the selection of the 'Common' folder on the SRV01 server, with the OK button highlighted to confirm the selection.
  • Validate by clicking on OK:
Screenshot of the Add Folder to Replicate dialog in the New Replication Group Wizard, showing the selected folder path 'D:\Common' with the OK button highlighted to confirm the replication folder settings.
  • Click on Next:
Screenshot of the Folders to Replicate step showing the confirmed folder path D:\Common, with the Next button highlighted to proceed.
  • Click on Edit to specify the path to the Common folder on the SRV02 server:
Screenshot of the Local Path of Common on Other Members step, showing details of member SRV02 with the Edit button highlighted to specify the local path or adjust settings.
  • Select Enabled and click on Browse:
Screenshot of the Edit settings for SRV02, showing the Enabled option selected for the replicated folder and the Browse button highlighted to choose the local folder path.
  • Select the Common folder:
Screenshot of the Browse For Folder dialog for SRV02, showing the Common folder selected and the OK button highlighted to confirm the folder choice.
  • Confirm by clicking on OK:
Screenshot of the Edit settings for SRV02, showing the local path set to D:\Common with the Enabled option selected and the OK button highlighted to save the configuration.
  • Click on Next:
Screenshot of the Local Path of Common on Other Members step, showing SRV02 with the local path D:\Common and the membership status set to Enabled, with the Next button highlighted to continue.
  • Finally, click on Create to create our Replication Group:
Screenshot of the Review Settings and Create Replication Group step, displaying the replication group settings summary, with the Create button highlighted to initiate the replication group setup.
  • Close the window after verifying that all steps have been successfully completed:
Screenshot of the Confirmation step in the New Replication Group Wizard, showing all tasks completed successfully, with the Close button highlighted to finish the setup.
  • In the DFS Management console, you should now see the Replication Group:
Screenshot of the DFS Management console showing the Common_Rep replication group with two replicated folders on SRV01 and SRV02, both with the local path D:\Common and membership status enabled.
  • After a few minutes (depending on network speed and the size of the data to replicate) we should see our two folders synchronized:
Two Windows Explorer with two shares that are synchronized
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address