I've been investigating how to check whether DFSR or FRS for Sysvol Replication is used with powershell. Here is my naive methods, I have tried to implement.
- Check if the DFS replication is installed
PS C:> Get-WindowsFeature|where Displayname -Match "Replication"
Display Name Name Install State
------------ ---- -------------
[ ] DFS Replication FS-DFS-Replication Available
So, this proves that it's using FRS over DFSR??
Check DN
$FRSsysvol = "CN=Domain System Volume (SYSVOL share),CN=File Replication Service,CN=System,"+(Get-ADDomain $domain).DistinguishedName $DFSRsysvol = "CN=Domain System Volume,CN=DFSR-GlobalSettings,CN=System,"+(Get-ADDomain $domain).DistinguishedName $frs = Get-ADObject -Filter { distinguishedName -eq $FRSsysvol } $dfsr = Get-ADObject -Filter { distinguishedName -eq $DFSRsysvol } if ( $frs -ne $null ) { Write-Host -ForegroundColor red "FRS" } elseif ( $dfsr -ne $null ) { Write-Host -ForegroundColor green "DFS-R" } else { Write-Host -ForegroundColor Red "unknown" }
This returns "FRS". But when I double check $frs
and $dfsr
output. Both are not $null
. Both return DN, Name, ObjectClass and ObjectGUID as well. So, What's problem here?