Use PowerShell to Check and Configure DFSR Content Freshness
Every morning I have a PoSh shower - I like to feel fresh - but did you know that DFSR servers like to be fresh, too?
Now, I'm not advocating showering with your DFSR servers - that would be weird, plus water and hardware isn't a good combination... rather, know that each DFSR server has a setting that's defines a threshold after which its content is considered stale. The setting is called MaxOfflineTimeInDays. Think of it as being a DFSR equivalent of Strict Replication Consistency. Once the content is considered stale, the DFSR server will no longer be able to replicate.
We recommend setting MaxOfflineTimeInDays to 60 days. And, you have to set it on a per server basis.
Of course, PowerShell can help you quickly and easily (words I use often when writing a post) check and configure DFSR Content Freshness. Here's how to check:
(Get-CimInstance -Namespace ROOT/microsoftdfs -ClassName DfsrMachineConfig).MaxOfflineTimeInDays
or < v3
Get-WmiObject -Namespace ROOT/microsoftdfs -Query "Select MaxOfflineTimeInDays from DfsrMachineConfig"
Alternatively, feed in a list of servers via your method of choice to check that your DFSR infrastructure is consistent and fresh:
"NINJARODC02", "NINJADC02" | ForEach-Object {
$MaxOfflineTimeInDays = (Get-CimInstance -Namespace ROOT/microsoftdfs -ClassName DfsrMachineConfig -ComputerName $_).MaxOfflineTimeInDays
Write-Host "$_ : $MaxOfflineTimeInDays Days"
}
Now to set the value on a server:
Set-CimInstance -Namespace ROOT/microsoftdfs -Query "Select MaxOfflineTimeInDays from DfsrMachineConfig" -Property @{MaxOfflineTimeInDays=60} -ComputerName NINJADC02
You get the picture. All WMI / CIM driven. Quick and easy. Like a shower.
My own MaxOfflineTimeinDays setting is 1 - after this threshold I'm considered stale and probably a bit funky, too.
Comments
- Anonymous
December 18, 2014
Use PowerShell to check that Strict Replication Consistency is enabled on all new DCs in elderly Active Directory forests.- Anonymous
April 20, 2018
Strict replication consistency is enabled by default unless your forest is upgraded from 2000. If you want to have strict replication enabled automatically on all newly promoted domain controllers you need to add CN=94fdebc6-8eeb-4640-80de-ec52b9ca17fa,CN=Operations,CN=ForestUpdates,CN=Configuration,DC=,DC= More info can be found here: https://blogs.technet.microsoft.com/askds/2010/02/15/strict-replication-consistency-myth-versus-reality/
- Anonymous
- Anonymous
May 11, 2016
Brilliant, thanks!