How it works...

Before you can use DFS to hold a DFS Namespace, you need to install the DFS Namespace feature. In step 1, you create a script block with the Install-WindowsFeature cmdlet, which looks like this:

In step 2, you look at the DFSN module and determine how many cmdlets the DFSN module contains, as follows:

In step 3, you create the folders and SMB shares on Srv1 and Srv2 that serve as the DFS Root as follows:

With the Root shares ...

Get Windows Server 2016 Automation with PowerShell Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.