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.