Windows Server: Error 4012 Appears in the DFS Replication Event Log of an Active Directory Domain Controller

Summary: If an Active Directory domain controller (DC) is unable to replicate SYSVOL data from a partner for a long time, SYSVOL replication stops. Error 4012 is logged in the Distributed File System Replication (DFSR) event log of the affected DC when this occurs. ...

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

Error 4012 (source: DFSR) appears in the DFSR event log of a DC. The event description includes the SYSVOL folder path, as shown here:

The DFS Replication service stopped replication on the folder with the following local path: C:\Windows\SYSVOL\domain. This server has been disconnected from other partners for n days, which is longer than the time allowed by the MaxOfflineTimeInDays parameter (60). DFS Replication considers the data in this folder to be stale, and this server will not replicate the folder until this error is corrected.

[The rest of the event description has been omitted.]

The local path may vary, though this article only applies if it mentions the SYSVOL folder. In the example above, n indicates the number of days the DC has been unable to contact a partner. This number varies but is always greater than the value of MaxOfflineTimeInDays.

Cause

Distributed File System Replication (DFSR) requires that replication partners be in regular communication. If a server is unable to communicate with a partner for a long time, replication is disabled on that server.

MaxOfflineTimeInDays, which has a default value of 60, represents the longest allowable time for servers to be out of communication with each other. This is analogous to, though separate from, the tombstone lifetime of an Active Directory forest.

Resolution

Note: Ignore the portion of the event description that says to remove the server from the replication group and readd it. This is not the correct procedure when dealing with SYSVOL replication.


Scenario 1: There is only one DC in the domain.

If there is only one DC in the domain, an authoritative sync of SYSVOL is necessary to ensure that replication occurs if another is added. See How to Perform an Authoritative Sync of SYSVOL Data Using Distributed File System Replication (DFSR) for the steps involved. Any steps that mention other DCs or forcing replication may be skipped.


Scenario 2: There are multiple DCs in the domain.

If there are multiple DCs in the domain, it is necessary to determine how many are affected by the issue. Do so by searching the DFSR event logs of the DCs for error 4012. All affected DCs have this error in their logs in the recent past.

  • If only one DC is affected, perform a non-authoritative sync of SYSVOL on that DC. See How to Perform a Non-Authoritative Sync of SYSVOL Data Using Distributed File System Replication (DFSR) for the steps involved.
  • If multiple DCs are affected but there are other DCs which are unaffected, perform a non-authoritative sync of SYSVOL on all affected DCs.
  • If all DCs in the domain are affected, one DC must be chosen as the authoritative source of SYSVOL data. This requires inspecting the data in the SYSVOL folder hierarchy of each DC and determining which copy is the most current. Once an authoritative source is chosen, perform an authoritative sync of SYSVOL on that DC. See Scenario 1 above for a link to the steps. Perform all steps of the procedure in order to synchronize SYSVOL on all DCs in the domain.

Additional Information

In a multi-DC domain, it may also be possible to resume replication on an affected DC by increasing the value of MaxOfflineTimeInDays. This has not been tested extensively but has resolved the issue on multiple occasions. To set MaxOfflineTimeInDays, run this command:

wmic.exe /namespace:\\root\microsoftdfs path DfsrMachineConfig set MaxOfflineTimeInDays=x

The value of x must be greater than the number of days indicated in error 4012. Restart the DFS Replication service after running the command and check the DFS Replication event log for errors. If replication has been failing for some time, events about conflict detection and resolution are expected. They indicate that DFSR is working as designed.

Once replication has resumed, run the command again with a value of 60 to return MaxOfflineTimeInDays to its default value. (This is optional.)

Affected Products

Microsoft Windows Server 2016, Microsoft Windows Server 2019, Microsoft Windows Server 2022, Microsoft Windows Server 2025

Products

PowerEdge R250, PowerEdge R260, PowerEdge R350, PowerEdge R360, PowerEdge R450, PowerEdge R550, PowerEdge R650, PowerEdge R650xs, PowerEdge R6515, PowerEdge R6525, PowerEdge R660, PowerEdge R660xs, PowerEdge R6615, PowerEdge R6625, PowerEdge R750 , PowerEdge R750XA, PowerEdge R750xs, PowerEdge R7515, PowerEdge R7525, PowerEdge R760, PowerEdge R760XA, PowerEdge R760xd2, PowerEdge R760xs, PowerEdge R7615, PowerEdge R7625, PowerEdge R860, PowerEdge R960, PowerEdge T140, PowerEdge T150, PowerEdge T160, PowerEdge T340, PowerEdge T350, PowerEdge T360, PowerEdge T440, PowerEdge T550, PowerEdge T560, PowerEdge T640 ...
Article Properties
Article Number: 000218367
Article Type: Solution
Last Modified: 28 Apr 2025
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.