Test-GphDfsReplicationMode.ps1

function Test-GphDfsReplicationMode
{
  <#
      .SYNOPSIS
      Test-ReplicationMode returns the Replication-Mode for the SYSVOL-Folder
 
      .DESCRIPTION
      The Script checks the Replication Mode of the SYSVOL-Folder. AD-Cmdlets must be available.
 
      .EXAMPLE
      Test-ReplicationMode
      Returns the ReplicationMode of the Domain
 
      .NOTES
      If the domain still uses FRS for SYSVOL-Replication, you can find the technet documentation migration here:
      https://blogs.technet.microsoft.com/filecab/2014/06/25/streamlined-migration-of-frs-to-dfsr-sysvol/
 
      .LINK
      URLs to related sites
      The first link is opened by Get-Help -Online Test-ReplicationMode
  #>



  [CmdletBinding()]
  param() 
  $DFSRGlobalSettings = Get-ADObject -Filter {
    name -eq 'DFSR-GlobalSettings' 
  } -Properties 'msDFSR-Flags'
  If ( $DFSRGlobalSettings.'msDFSR-Flags' -eq 48 ) 
  {
    'ReplicationMode DFS' 
  }
  Else 
  {
    'ReplicationMode FRS' 
  }
}