Handy Tips when troubleshooting Active Directory Replication Issues

, ,

Over the years I’ve come across a number of different environments with many running Active Directory in many different states. Replication is an important part of ensuring that your AD environment is healthy and highly available to service end users. I’ve compiled some notes around Active Directory Replication commands and gathering information.

Firstly, just give the server a quick look over, make sure it has plenty of hard disk space wherever the Active Directory NTDS database lives and a quick look in the event viewer for anything out of the ordinary, this usually reveals the issue and you can start to troubleshoot and fix. Otherwise we can use some of the tools below to dig deeper into the AD environment.

repadmin

A quick way I check to ensure replication is going okay is to use the replsummary command, this will give me an output of each replication relationship for each domain controller as well as the delta size, last change time and any errors.

repadmin /replsummary

You can also pipe the replication relationships and summary to a csv, which is a good way to dig into the environment and getting an understanding of how everything fits together.

repadmin /showrepl * /csv > rep.csv

In order to force Active Directory replication, we can issue the command repadmin /syncall /AeD on the domain controller which we want to update the Active Directory Database for, for example DC02 is out of Sync we run the command on DC2.

  • A = All Partitions
  • e = Enterprise (Cross Site)
  • D = Identify servers by distinguished name in messages.
repadmin /replicate DC01-PRD.stg.local DC02-PRD.stg.local DC=Prod,DC=stg,DC=local /selsecrets

By default this does a pull replication – which is how AD works by default.  If you want to do a push replication use the following command:

repadmin /syncall /APeD

You want to do a push replication if you make changes on a DC and you want to replicate those changes to all other DC’s.  For example, you make a change on DC1 and you want all other changes to get that change instantly, run repadmin /syncall /APeD on DC1.

For all repadmin syntax please see this link on Microsoft

dcdiag

dcdiag is another simple tool you can use to quickly run a number of tests across your active directory, I generally run this as part of an audit and pipe the output to a text file for review later.

dcdiag > dcdiag.txt

This will test things like DNS, Group Policy, AD DS Services, Replication and reachability of services across the Active Directory environment and is a quick way to get a quick snapshot of overall health.

nltest

nltest is another tool you can use to analyse the local machine and connectivity to active directory. Most of these commands will require a domain, in this case stg.local but change that with your own AD namespace. We can do a secure channel test to ensure a client has connectivity to a domain controller (and what domain controller)

nltest /sc_query:stg.local

We can also identify domain controllers via DNS

nltest /dnsgetdc

And we can also reset the secure channel if the machine complains about the trust relationship between this workstation and the primary domain has failed, hint there is also a cool powershell command for this

nltest /sc_reset:stg.local

All of these tools are quite powerful, but knowing just a few of these commands will get you a long way in understanding what the issue is or could be.


Leave a Reply

More Posts

An error occurred while attempting to start the selected virtual machine(s) The security ID structure is invalid (0x80070539)

So I was recently working with some really old Virtual machines in a development environment that came across from another organisation. One particular virtual machine gave me an error message when I tried to start it up “An error occurred while attempting to start the selected virtual machine(s)… The security ID structure is invalid (0x80070539)”.  When this happens, […]

Getting a list of users in Active Directory as well as their Logon Script using dsquery and dsget

So I’m preparing on doing a clean-up of our NETLOGON/SYSVOL folder containing about 50 or so different logon scripts (plenty of which I know are no longer used).  I wanted to create a list of all of our active directory users along with what logon script they were assigned (I could then feed this list […]

Renaming a Hyper-V Failover Cluster

If you find yourself taking over a cluster with a name that is silly or doesn’t make sense, you can rename it without much issue. Your main thing to watch out for are backup software that target the cluster (such as Veeam or DPM). You just need to ensure they are reconfigured to use the […]