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-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 ...

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