Repadmin.exe is a powerful utility for troubleshooting and monitoring the overall health of Active Directory. Microsoft provides minimal information about the utility and no assistance on how to effectively use the commands and sub-commands for troubleshooting. This video is a step-by-step coverage of commands, syntax, and sub-commands and how to use this powerful tool to effectively monitor and troubleshoot various Active Directory replication issues. This video is Part 1 and is available to anyone and all subscribers.
"Everybody can be great... because anybody can serve. You don't have to have a college degree to serve. You don't have to make your subject and verb agree to serve. You only need a heart full of grace. A soul generated by love." Martin Luther King Jr.
Hello, my name is Lowell Vanderpool and this channel is dedicated to IT students,
IT professionals, and anyone who enjoys learning technical subjects.
In this presentation and demonstration, we're going to be looking at how to troubleshoot
Active Directory replication. Mr. Vanderpool, isn't everyone moving to Azure Active Directory?
Well, a lot of people are, but there is a lot of organizations that find Azure Active Directory
way too expensive for their budget and for their company. It just doesn't make sense.
So if you have a premise-based Active Directory with domain controllers,
you need to understand how to troubleshoot Active Directory replication. And this video is for you.
Now, Active Directory replication is complex. The data structure in Active Directory is complex
and many organizations have complex networks. So the two of those combined can make troubleshooting
very difficult. Active Directory replication is not just synchronizing data on two domain
controllers, but it's more nuanced than that. It's synchronizing the state of that Active
Directory. When we have a virtual machine and we do a snapshot, we're capturing the state.
All the critical time-sensitive elements in that PC are captured at a moment in time.
That's known as a state. We're also going to do that with Active Directory.
Main controllers in a domain must quickly and accurately synchronize Active Directory databases.
They must synchronize DNS zones and global catalog. When we look at our Active Directory
database, it's broken down into what's known as partitions. We have a configuration partition,
a schema partition, a domain partition, which is typically what we as IT professionals think of.
We think of where our users and groups and computers and domain controllers are at.
That's all in the domain partition in Active Directory. But there are other logical divisions
in Active Directory that contain things like the application partition. If you've got Exchange
or SharePoint services, they require that optional application partition. These partitions
add to this complexity of replicating data. Now, this slide is busy, but it's absolutely
essential. We must understand terms, concepts, and we have to understand what is happening with
replication in order to troubleshoot it. Look at the top. I've got a graphic at the top of the
slide, and that indicates a forest. I've got domain A, domain B, domain C, and domain D.
They're all in one Active Directory forest. Down below, I've broken up domain A, B, and C,
and left off D because I ran out of space. But in domain A represents the complexity of Active
Directory in any one domain. Active Directory is made of partitions, schema, configuration,
domain partition. Then we have DNS information that replication is responsible for replicating
across various domain controllers. Then we have global catalog. All of those are partitions
in our Active Directory that we need to replicate. Notice we have blue double arrows and we have
pink double arrows. The partitions that only replicate within their domain are going to be
in pink. The partitions of each domain controller that replicate across the entire forest
you see schema, configuration. Down below, you see forest DNS zones. Those components of our DNS
that have to go across the entire forest, they have to be replicated across the forest.
Then we have global catalog, again, across the forest. This, again, shows you the complexity
of replication. But these are very important concepts because we're going to use RepAdmin
to go in and say, look at this connection between this schema and this schema and check out what's
going on with this particular functionality. Or we may be looking at domain B and why,
between one domain controller, we don't have that domain replication that we need to have.
RepAdmin is going to give you that granular ability to zoom in on any one of these areas
and troubleshoot. Got to understand this. The Active Directory replication model is built on
four pillars or models. One, multi-master domain controllers. You can see here on my graph,
I've got domain controller A1, A2, A3, and A4. If all three of those domain controllers, A2,
A3, go out, domain controller A1 can handle all the things that need to be done in that domain.
Second model, efficiency. We don't want to use all of our local area network traffic,
and we sure don't want to use all of our WAN connection traffic just to replicate Active
Directory. So efficiency and transferring of that data is critical in replication.
We want reliability. I want an Active Directory that's reliable and consistent.
And then the last is conflict resolution. I've got a domain controller in Singapore. I've got
another domain controller in New York City. I've got two domain admins that are modifying the same
object. We have to have a way, a method that will reliably deal with those conflicts.
Active Directory must understand your physical network structure. It has to understand your
local area networks. It has to understand the subnets in your network. It needs to know where
your domain controllers are, how many domain controllers you have in Europe, how many are
in Denver, what subnet are those domain controllers on. In every WAN connection between, say, Europe
and Denver and Denver and Australia, Asia, those WAN links, we need to assign a metric value
so that the replication algorithm will properly set up the proper replication.
How do we set up a logical map of our physical network? We're going to use
Active Directory sites and services. You can strictly do all of this with PowerShell.
We're going to use a utility called dssite.msc, the old MMC utility, Active Directory sites and
services. And with this, we're going to build a logical map of our physical network, subnets,
sites, inter-site connections or our WAN links. And with that accurate logical map, Active Directory
can automatically build a replication model that will work. When I build this model using
Active Directory sites and services of my physical network, my subnets, my local area networks, my
WAN links, all of that information is going to go into the configuration partition of your Active
Directory. Now, it would have been helpful if I could have built a complex WAN LAN environment
so that we could have actually seen how all that works. My lab environment is going to be a forest
with one domain and three domain controllers. But I promise you, if you master a simple scenario,
it makes it so much easier as you move into the more complex. But the idea of learning to
troubleshoot anything like this is break it down to its simple components. And that's what we're
going to do. Then with a mastery of the simple, you can start going across even a complex network
like this and troubleshoot effectively. We're going to spend most of the time using repadmin.exe.
You're going to see it's a powerful utility. Now, Microsoft does give you a lot of commandlets
addressing that in PowerShell. So if you'd like to look at them, you can just do get-command
wildcard-addrep wildcard, and it will give you a list of all your commandlets dealing with
replication. Well, what about Azure Active Directory? Many of you probably have Azure
Active Directory also. You're going to set up, you're going to use your virtual networks to go
ahead and build your cloud, your virtual networks, connect them to your physical networks. And then
when you run Azure Active Directory, it will then understand how to build those replication components
because it understands what you built in terms of your network. Today, it's very common to have
Azure Active Directory and then connect it to your premise Active Directory. That still leaves you
a premise Active Directory to troubleshoot in terms of resolution, whether you have the cloud
or you don't. Now, repadmin.exe is going to be extremely powerful. The problem is the syntax
and the help that Microsoft gives you is awful. The goal of this is to break this powerful utility
down so that all of a sudden now you can face your replication issues and really understand
how to leverage this utility. Now, we can run this in PowerShell or in command prompt. Both of those
have to be elevated as an administrator. Keep in mind, when you use this tool, you can impact
Active Directory. So, it's important that you understand what you're doing so that you don't
end up breaking your Active Directory domain services installation. So, there are going to
be certain commands that I'm going to say, wait, hold it, be careful. The use of these commands
can get you into trouble. So, I will warn you when we get to some of those commands. Again,
we have to build a logical map using AD, sites and services, or PowerShell of our physical network
structure. Active Directory can't build an effective replication model without first us
showing how our network is structured. We're going to study this graphic to understand terms
and concepts. We have to understand terms and concepts for us to understand the utility that's
going to help us solve problems. One concept in Active Directory replication is the idea of a site.
Typically, you could think of a site as a local area network. I have a site and replication
on a site. I've got here, notice on the left, I've got three domain controllers.
They're replicating and this is called intra-site replication. We're going to be using RPC over IP
to replicate all of our data. So, RPC is a protocol over IP is going to be doing the replicating
across the network. You can have as many subnets on any site as you want, but you have to tell
Active Directory and Active Directory sites and services those subnets. Then we have another
site over here on my right, and I've got two domain controllers. Again, RPC over IP is the
protocols I'm using to communicate and replicate this information. When I want to replicate my data
from my right site to my left site, this is called inter-site replication. Typically,
this is going to be a WAN connection and I must be able to assign a metric so that my replication
algorithm can decide how often to replicate and how to do that most effectively. Up here,
NetLogon is going to look at these sites and is going to put in DNS and SRV record
that's going to give specific information about these sites. Why is that very important? That's
very important because those clients are going to go to that DNS SRV record and say,
I know which controller to use to log on, to authenticate, to do all this stuff.
If I have a client over in my left site and it doesn't have a proper DNS SRV record about it,
it will try to come over across the WAN link and use one of these domain controllers on my right
site to authenticate. You know where that's going to go. Helpdesk. These terms and concepts are very
important understanding replication. We're looking at topology again. Look at sites. Sites
must have at least one subnet and some will have many. You can link a site to another site and
schedule replication and assign link cost based on WAN speed and latency. Look at the graphic on
the bottom right. You can see the administrator has connected sites together. This is called
inter-site and he has already assigned a cost to each of those inter-site links. Now, look at the
top right graphic where the administrator decided I want all traffic to go through site A. So,
he's created a site link from A to B and A to C. Later on, he makes a change and now he connects
C to B. You can do that all day long. Now, one last concept before we leave this page. If I have
a couple domain controllers on site A and a couple domain controllers on site B, I may choose
one on site B and one on site A and I will call them bridgehead servers. Basically, they're
responsible for the replication across those two sites. I can do more than one but I need at least
one bridgehead server. Now, here's another interesting design. We've got three sites.
Notice we have physical connections between site Y and site X, site Y and site Z but the
administrator wants a logical. He does not have a physical connection but he wants a logical
connection between site Z and site X. You can create what's known as a site link bridge. It
gives you a logical connection, not a physical connection but a logical connection between
two sites. Again, here's my lab that I'm going to do all my demos from. I've got my forest,
homelab.tech70.productions.com. I have one domain, homelab, and I have three domain controllers
on that domain, DC1, DC2, and DC3. Let's say I have a site and I've got 10 domain controllers
on it, a data center. What KCC, the knowledge consistency checker algorithm, will do is it
will automatically begin to build connections between all those domain controllers but it
doesn't connect them all together. It will connect a subset of domain controllers together.
So, notice in my sites and services, I'm looking at NTDS settings of my DC1 and notice in the pane
next to it here, I've got two automatic generated connections. One connection is shown up here
and I can see I'm going to be connected to DC2 and DC3 and I'm going to replicate from them.
And then down here, I have another connection. I've got DC2 and DC3 and I'm going to replicate
to them. So, I have source and destination. KCC automatically sets up this connection between
domain controllers. You don't have to do it. This is intra-site replication.
Look on the slide down here. I've got DC1 and KCC built a connection between DC1 and DC2.
It also made a connection between DC1 and DC3. Notice this is bidirectional. So,
we do have a source and destination and the KCC algorithm will automatically do this
with all your domain controllers on a site. Now, Microsoft's replication is a pull-based
replication. Look at my graph here. I've got an administrator that's making an LDAP
write to Active Directory. So, there's a change. DNS is always being changed as new computers boot
up and new IP addresses are assigned or whatever. So, DNS is always being changed.
Over here, I've got my two domain controllers, DC1 and DC2. Notice the communication.
Kuros, of course, they authenticate. And then DC1 notifies DC2 of a change,
but it doesn't do anything other than that. DC2 has to request that change. That's the
pull operation. And then DC1 sends them the data change. Now, I've broken down the pull replication
step-by-step and it's detailed on the left of the slide. But you can see in the connection
properties of NTDS settings for each domain controller, we'll have a group of domain
controllers that are source and a group of domain controllers that are destination.
Our KCC builds these connections and that is exactly what they're called in Active Directory
replication. Now, two terms are talked a lot about in Microsoft replication documentation.
One is the Knowledge Consistency Checker, KCC. And then you can even see in the Active Directory
sites and services, they talk about NTDS service and settings. And I'm looking all over for this
NTDS. I thought maybe it's a process, maybe it's a thread, maybe it's a service. No.
So being a curious nerd that I am, I got out my Process Explorer and began to search
for NTDS and KCC. Well, I found KCC. It's a DLL or you see the green arrow. And when I went into
Process Explorer, I just typed in the word NTDS looking for a handle or a DLL. And there was a ton
of files and DLLs that are named NTDS. But look at the process that owns them.
It's the Local Security Authority Subsystem Service, LSASS. Now, you have this process
on both clients and servers. Once you promote your member server to a domain controller,
LSASS explodes in features and functionality. All of this is added to the Local Security
Authority Subsystem Service on your domain controller only. So if you're looking for
NTDS or KCC, you better go to Process Explorer. Now, let's take a look at what we're going to
be covering in part two of this presentation and demonstration. We're going to be looking
at RepAdmin forward slash KCC. This allows you to rebuild replication topology for your
intra-site domain controllers. We're going to cover the syntax very carefully so that as you
explore more of the RepAdmin tools, you'll understand how to break out some of those syntax.
Those syntax can be really complex. We're going to learn two critical avoid
unnecessary replication. One is called the up-to-dateness vector, and the second one is
a high watermark. Both of those are important in understanding how does Active Directory prevent
unnecessary replication. We're going to learn how to break out the RepAdmin subcommands,
which are the power of this utility and tool. We're going to look at RepAdmin forward slash
replicate, which is a powerful partition level replication tool. So if you need to
analyze a certain partition on your Active Directory database in its replication, you can
use the forward slash replicate. We're also going to look at the RepAdmin options command and all
the features that that provides. As I said in the very beginning, the RepAdmin tool is a very
powerful and complex utility. We're going to look at SysInternals AD Explorer. It's going to provide
some really helpful, helpful tools in extracting data out of Active Directory. We're going to look
at how to use RepAdmin to monitor the health of your AD replication, because it's very important
to monitor what's going on with your AD replication as well as troubleshoot it when problems exist.
We're going to look at what USN numbers are and why they're so important in understanding AD
replication. I'm actually going to show you how this thing works. Then we're going to look at the
show up-to-dateness vector command and how you can use that to analyze your Active Directory
replication. And then we'll also look at LDP.exe. Very cool GUI tool, especially helpful for
extracting information out of Active Directory. So Mr. Vanderbilt, how do I get access to part two
of RepAdmin? Well, you have to become a member. So you go to our homepage and you join. You're
going to be asked to give a name and you'll pay $2.99 a month, a cup of coffee a month.
That amount helps us provide the necessary resources so that we can continue doing this
channel. Be sure to send me an email with the name that you chose in creating your joining the
channel, and I will immediately send you the links to all the resources you need. From that point on,
you'll be notified via the email you chose to join the channel with. As we add more and more content,
you'll be automatically notified. But reach out and contact me if you have any questions or
concerns or you feel like you missed something. Reach out and connect with me. I'll be happy to
provide you the resources. And thanks a lot for joining the channel.