How to do it...

  1. Install DFS-Replication feature on key servers:
      $Sb = {Add-WindowsFeature -Name FS-DFS-Replication `
                                -IncludeManagementTools 
      }
      Invoke-Command -ScriptBlock $Sb `
                     -ComputerName DC1, DC2, FS1,                                        FS2, SRV1, SRV2 |
      Format-Table -Property PSComputername,                                   FeatureResult, Success
  
  1. Turn on administrative shares:
      $Sb = {
              Set-SmbServerConfiguration `                          -AutoShareServer $true `
                          -AutoShareWorkstation $true `
                          -Confirm:$false
      }
      Invoke-Command -ScriptBlock $Sb `
                     -ComputerName DC1, DC2, FS2, FS2,                                            SRV1, SRV2
  1. View DFS cmdlets:
      Get-Module -Name DFSR -ListAvailable
      Get-Command -Module DFSR | Measure-Object
  
  1. Create and display replication groups:
      New-DfsReplicationGroup `
         -GroupName FSShareRG `
         -DomainName Reskit.Org `
     -Description ...

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.