Saturday, January 04, 2020

Technical Post - Netlogon and SYSVOL not creating when promoting server to Domain Controller

Here's one that's been bugging me for a few months now..

At one of the schools we support, we needed to add an additional domain controller to an existing domain.  Sounds simple right? 

During the promotion process, the server creates the SYSVOL and Netlogon folders, but they wouldn't share.

The new server is running Microsoft Windows Server 2019, whereas the older server is still running 2012.

After doing some Googling, it appears this is a more common issue than I had originally thought, which is surprising since I've promoted and demoted many domain controllers over the years and have never had an issue like this.

Anyway, I managed to solve it in the end with a bit of searching.

Firstly, on the newer server, open Regedit and browse to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters"

Change SysVolReady from 0 to 1

This will create the SYSVOL share.

To create the Netlogon share, I then had to manually create a folder called 'scripts' in the following location - c:\windows\sysvol\domain\

Once created, restart the Netlogon service.

That's the folders created and ready, but alas replication is not working between the servers.  Onwards to the next step...

On the old domain controller, look in Event Viewer for an error regarding DFS Replication (ID 2213).  The error will read "The DFS Replication service stopped replication on C:  This occurs when a DFSR JET database is not shut down cleanly and Auto Recovery is disabled."

Beneath the error will be a GUID.  Copy this long number.

Open an elevated command prompt and enter

wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="00000000-0000-0000-0000-000000000000" call ResumeReplication

Where 00000000-0000-0000-0000-000000000000 is, enter the GUID number from the error message (ID 2213)

Now run the following command to see the state of replication and you 'should' see that all servers are now showing State 4 (Normal) and replicating successfully.

For /f %i IN ('dsquery server -o rdn') do @echo %i && @wmic /node:"%i" /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo WHERE replicatedfoldername='SYSVOL share' get replicationgroupname,replicatedfoldername,state

For information, the other states are....

0 = Uninitialized
1 = Initialized
2 = Initial Sync
3 = Auto Recovery
4 = Normal
5 = In Error

Now Active Directory and file replication between DCs should be working (you can double-check by running DCDIAG and looking for any errors).

I hope this helps someone!