Monday, September 19, 2016

DFS-R stopped replication Event 4012

If the DFS-R service stopped replication and you can see Events with ID 4012 in the DFS Replication Log, you can do the following steps to resolve this issue.
First have a look into the event 4012:

In the log we can see that the server has been disonnected for 101 days. To resume the replication, we have to change MaxOfflineTimeInDays to a value above 101 or rebuild it.
I will show you how to set the value to resume the replication. Just do the following steps:
- Set MaxOfflineTimeInDays in cmd:
wmic.exe /namespace:\\root\microsoftdfs path DfsrMachineConfig set MaxOfflineTimeInDays=102
- Restart DFS-R service in cmd:
net stop dfsr && net start dfsr

After that you can check the DFS Replication log and you will see that the replication resumed. It´s normal that it will detect conflicts (Event 4412).

Next Steps:
To prevent this issue, you can create a Powershell script that search for Event 2213 is logging the ROOT cause for Event 4412 that will be generated 60 days later. If an event was found it will send out an email. The Powershell script will be executed on a daily base in a schedule task, so you will be informed if this event happen on your server.