DFSR event 4012 — replication stopped after exceeding MaxOfflineTimeInDays
A DFS Replication member was offline longer than the configured limit, so DFSR stopped replicating that folder rather than risk resurrecting deleted files.
What you see
Event 4012 in the DFS Replication log. Files stop syncing between servers. On SYSVOL this also means Group Policy stops replicating, which is far more serious than it first appears.
What is actually wrong
The server was down or disconnected for more than 60 days by default. DFSR deliberately refuses to resume because its change journal no longer overlaps.
Codes and articles
Fixes (2)
Resume replication on a data folder
A normal replicated folder. Be aware that resuming will re-replicate deletions that happened while this member was offline.
Confirm the state and read which folder is stopped.
Get-WinEvent -LogName 'DFS Replication' -MaxEvents 30 | Where-Object Id -in 4012,2213,5002 | Format-List TimeCreated, Id, MessageUnderstand what resuming means: any file deleted on the other members while this one was offline will be deleted here too. If this server has the only copy of something, take a backup of the folder first.
DFSR does not merge — it converges. That is the whole reason it stopped rather than resuming automatically.
Resume the replicated folder using the volume GUID from the event.
$d = Get-WmiObject -Namespace root\microsoftdfs -Class DfsrVolumeConfig -Filter "VolumePath='\\\\.\\C:'"$d.ResumeReplication()
Watch the backlog drain.
dfsrdiag backlog /rgname:"Group" /rfname:"Folder" /smem:SRV01 /rmem:SRV02
dfsrdiag replicationstate /allRebuild SYSVOL replication with an authoritative restore
SYSVOL is the affected folder. Pick the DC with the SYSVOL contents you trust as authoritative — usually the PDC emulator.
Identify the PDC emulator and confirm its SYSVOL contents are correct.
Get-ADDomain | Select-Object PDCEmulatorBack up the SYSVOL folder on every DC before touching anything.
robocopy C:\Windows\SYSVOL_DFSR D:\sysvol-backup /EThis procedure overwrites SYSVOL on every non-authoritative DC from the authoritative one. If the wrong DC is chosen, every DC ends up with the wrong policies.
Stop the DFS Replication service on all DCs.
Stop-Service DFSROn the authoritative DC, set msDFSR-Options to 1 on its SYSVOL Subscription object, and set msDFSR-Enabled to FALSE on all DCs' subscriptions.
Start DFSR on the authoritative DC, wait for event 4602, then set msDFSR-Enabled back to TRUE on the others and start their DFSR services.
Force AD replication so the flags propagate.
repadmin /syncall /AdeP
Get-WinEvent -LogName 'DFS Replication' -MaxEvents 10 | Where-Object Id -eq 4602Reference
Related faults
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.