O'Reilly logo

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition by Thomas Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Install DFS Namespace, DFS Replication, and the related management tools:
      Install-WindowsFeature -Name FS-DFS-Namespace `
                             -IncludeManagementTools `
                             -ComputerName Srv1
      Install-WindowsFeature -Name FS-DFS-Namespace `
                             -IncludeManagementTools `
                             -ComputerName Srv2
  1. View the DFSN module and the DFSN cmdlets:
      Get-Module -Name DFSN -ListAvailable
      Get-Command -Module DFSN | Measure-Object
  1. Create folders and shares for DFS Root:
      $Sb = {
      New-Item -Path E:\ShareData -ItemType Directory `                                  -Force | Out-Null
      New-SmbShare -Name ShareData -Path E:\ShareData `                                   -FullAccess Everyone
      }
      Invoke-Command -ComputerName Srv1, Srv2 `                     -ScriptBlock $Sb
  1. Create DFS Namespace Root pointing to ShareData:
      New-DfsnRoot -Path \\Reskit.Org\ShareData ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required