Active Directory AutoRecovery from Dirty Shutdown

The Problem

I found couple of events in a Windows 2012 Domain Controller that indicates a problem in the DFS replication. Event ID: 2231.

It turned out that Microsoft had published a hotfix that will disable the ability to AutoRecovery after dirty shutdown. I am sure that the domain admin will not always updated if one of his domain controllers suffered a power failure, which will cause DFS to be broken and SYSVOL to stop replication.

The bad news, is that Microsoft made this the default behavior for Windows 2012 !

How to solve this

Find out what drive holds your DFS folders, if it is the C drive, then type the following to know what is the volume ID :

Mountvol C:   /L

Then :

wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid=?{Volume-ID}? callResumeReplication

(do not include the ?{? and ?}? when replacing the volume-id

Finally, run :

wmic /namespace:\\root\microsoftdfs path dfsrmachineconfig setStopReplicationOnAutoRecovery=FALSE