Start > Run > cmd > Type the following command:
"wmic.exe /namespace:\\root\microsoftdfs path DfsrMachineConfig set MaxOfflineTimeInDays = 999"
Verify the MaxOffline attribute has changed successfully to 999. Type the following command:
"wmic.exe /namespace:\\root\microsoftdfs path DfsrMachineConfig get MaxOfflineTimeInDays"
Note: Remove the quotes.
$dfsrPath = Get-WmiObject -Namespace root\microsoftdfs -Class DfsrMachineConfig
$currentValue = $dfsrPath.MaxOfflineTimeInDays
$requiredValue = "999"
if(!($currentValue -eq $requiredValue)){
Write-Host "Required value does not exist"
Write-Host "Current value: $currentValue"
Write-Host "Required value: $requiredValue"
Write-Host -Verbose "Going to set MaxOfflineTimeInDays value"
Set-CimInstance -namespace root/microsoftdfs -query "select maxofflinetimeindays from dfsrmachineconfig" -property @{maxofflinetimeindays=$requiredValue}
}
else{
Write-Host "The value of MaxOfflineTimeInDays already Exists. No Action Required"
Write-Host "Current value: $currentValue"
Write-Host "Required value: $requiredValue"
}