The Repadmin tool provides a graphical interface to manage Active Directory replication. It displays the state of each site in your directory and their replication partners, as well as allows you to change settings for replication or start/stop all sites at once.
The “repadmin /syncall /force” is a command-line tool that allows users to manage AD replication. This article will give lots of examples of how to use it.
Replication is typically not a major issue in a small Active Directory (AD) system. However, as the environment expands and new locations are added, replication issues become more prevalent. Repadmin is an excellent tool for debugging replication problems and determining what went wrong.
Repadmin is an important tool in every AD administrator’s toolbox since it enables you to inspect and debug AD replication topology from the viewpoint of each domain controller (DC). This guide will walk you through a step-by-step process for mastering the Repadmin tool.
Changes in Active Directory Replication Can Be Detected Using Repadmin
Let’s get started!
If you want to follow along with the examples in this article and make sure they relate to your situation, make sure you have the following items:
Windows Server 2008 or above on at least two replicating DCs — The following are the resources used in this lesson. The Active Directory Domain Services (AD DS) role is deployed on all DCs in the forest/domain test.local.
- DC01 — A Windows Server 2019 server in Site1 of an Active Directory site.
- DC02 — A Windows Server 2019 server in Site1 of an Active Directory site.
- DC03 — A Windows Server 2016 server in Site2 of an Active Directory site.
Download the Windows Server 2003 x86 Administration Tools if you still have an older DC running Windows Server 2003.
The Repadmin Tool Is Launched
Before you begin managing AD replication with repadmin, you must first install it and familiarize yourself with it. You must be connected to a DC through RDP or have the Remote Server Administration Tools (RSAT) package installed on a domain-joined workstation to use repadmin. All demonstrations will be done on a DC in this course, and the most often used repadmin commands will be shown.
How to Install and Import the Active Directory Module in PowerShell
On any DC that is available:
1. Log in as an administrator and open a command prompt.
2. To get a sense of what you’re up against, run repadmin with no arguments. Repadmin provides a comprehensive help text that includes all available parameters.
Repadmin is being run without any arguments.
Replication Health Summary (repadmin /replsummary)
If you’re just getting started with AD replication troubleshooting, start broad and work your way down. The replsummary option is a good place to start since it provides a comprehensive overview of overall replication health.
The replsummary parameter offers an overview of AD replication health. When you run repadmin /replsummary, you’ll get something like this.
For each DC, the output is as follows:
- Source DSA – Outgoing replication statistics.
- Stats on incoming replication for Destination DSA.
- The largest replication gap across all site links for a certain domain controller is known as the largest delta.
- Fail – The total number of times a replication attempt was unsuccessful.
- Total – The total number of tries at replication.
- The proportion of times replication failed is expressed as a percentage.
- Error — Shows any replication errors as well as the error code, for example (1722) The RPC Server is not accessible.
Start Time for Replication: 2021-07-26 23:35:41 Starting to gather data for the replication summary, which may take some time:…… Source DSA’s biggest delta fails, resulting in a total percent percent mistake. DC01 44m:47s 0 / 10 0 DC02 38m:32s 0 / 5 0 DC03 14m:47s 0 / 5 0 DC01 44m:47s 0 / 10 0 DC02 38m:32s 0 / 5 0 DC03 14m:47s 0 / 5 0 Destination DSA’s biggest delta fails, resulting in a total percent percent mistake. DC01 0 / 5 0 38m:32s DC03 11m:38s 0 / 5 0 DC02 44m:47s 0 / 10 0 DC02 44m:47s 0 / 10 0 DC02 44m:47s 0 / 10 0 DC02 44m:47s
Replication Neighbors Inspection (repadmin /showrepl)
Each DC duplicates with another DC known as its partner or neighbor in a multi-DC AD scenario. Knowing the replication topology is crucial knowledge to have when diagnosing replication difficulties.
Run repadmin /showrepl to learn more about replication partners. This command reads the local AD database and gives you a lot of useful information about the last time each DC attempted to replicate its neighbor’s AD partition, also known as a naming context or replication context.
You may read replication information from a remote AD database by passing the DC hostname as the final parameter, for example, repadmin /showrepl DC02.
The /showrepl argument displays a variety of information, including:
- The DC closest to you to reproduce from.
- Whether the DC is a Global Catalog or not.
- The DC’s replication method (IP or SMTP).
- For each naming context, there are links to the site.
- GUID is the site’s link.
- When was the last time the DC tried replication, and what was the result?
For all name circumstances, finding DC replication partners is a must.
Replication Queues Monitoring (repadmin /queue)
A DC might fall behind its neighbor depending on the replication schedule. When it occurs, the length of the wait starts to grow. The queue represents the amount of objects awaiting replication from its source neighbor.
The queue on the DC should be 0, indicating completely replicated partitions, however on a busy network, the backlog might start to grow.
Run repadmin /queue to see the queue, as shown below. You can see that the DC is totally reproduced with its neighbor in this case.
Using repadmin to check AD replication queues
If you observe that the line is steadily increasing, you may have a problem. If this is the case, be sure to look into the following:
- CPU use on the DC (Source replication partner).
- There are too many replication partners running at the same time.
- The network connection is slow.
- There have been far too many modifications to Active Directory objects.
Checking the Topology of Inbound Replication (repadmin /kcc)
Each DC performs a Knowledge Consistency Checker to determine replication topology (KCC). The KCC is in charge of ensuring that each DC knows who its incoming neighbor is. The KCC runs every 15 minutes by default, but you may manually start it if necessary.
If you delete a site connection or modify the replication settings in any way, it’s a good idea to manually run the KCC to review the replication topology. To do so, type repadmin /kcc into the command prompt, as shown below.
The KCC returns the site and DC you’re running it on, as well as whether or not the check was successful.
The KCC is being run.
You may also use the site parameter to initiate the KCC on all DCs in a site, such as repadmin /kcc site:Site1.
Replicating a Partition Manually (repadmin /replicate)
Even though partitions usually remain in sync, manually forcing a replication might be useful when troubleshooting. You may obtain rapid feedback on whether replication is functioning or not by forcing replication between DCs.
Use the /replicate argument to start a manual replication, as demonstrated below. Three parameters are required for the /replicate parameter, with the rest being optional:
- The DC to whom the replication should be sent.
- The DC that will be used to reproduce from.
- To reproduce, you’ll need a naming context.
Repadmin /showrepl will provide the naming context.
Repadmin /replicate <Destination_DSA> <Source_DSA> <Naming Context>
The operation below, for example, would replicate the Schema partition from DC01 to DC02.
CN=Schema,CN=Configuration,DC=test,DC=local Sync from DC01 to DC02 finished successfully. repadmin /replicate DC02 DC01 CN=Schema,CN=Configuration,DC=test,DC=local
Replication for All (repadmin /syncall) is manually invoked.
The /syncall argument is the nuclear technique if the /replicate parameter duplicates a single partition. All partitions on all DCs may be synced using the /syncall argument.
As you’ll see below, the /syncall argument is useful when you want to test the full replication topology or even emulate the behavior of the /replicate parameter.
DCs in the Same Site Replicating a Single Naming Context
To test replication to/from, the /syncall option only needs one argument, the DC. If you wanted to test replication to/from a DC named DC01, for example, you’d execute the command below. Only the Configuration directory partition would be replicated with this operation.
Repadmin will only test replication to/from DCs within the same site if you just provide the DC to test replication to/from.
/Syncall DC01 /d Repadmin
Repadmin is used to replicate the Configuration naming context for a DC.
All Naming Contexts for DCs are Replicated at the Same Site
But what if you need to copy all naming contexts to and from a specific DC inside the same site? You’d use the /A argument in that situation. As you can see in the screenshot below, the output now contains all naming contexts.
/Syncall DC01 /d Repadmin /A
To compel replication across all DCs in all locations, use the /e parameter.
Repadmin is used to replicate all naming contexts for DCs in a single site.
Please keep in mind that all arguments are case-sensitive!
Replication is being pushed.
DC replication is configured to be a pull operation by default, but it may alternatively be configured to be a push operation. For example, instead of DC02 fetching changes from DC01, you could require DC01 to deliver updates to DC02. To do so, use the /P parameter to reverse the replication direction.
As you can see in the diagram below, replication occurs from DC01 to DC02.
/Syncall DC01 /d Repadmin /P
Using repadmin to force push replication
Replicating a Single Object: Getting Granular
You were duplicating all changes in the previous examples, however repadmin may also be granular and repeat a particular AD item. You may choose a single object and manage its entire replication from source to destination DC with the /replsingleobj argument.
Let’s take a look at a user object called User1 that was replicated from DC02 to DC01.
The user object distinguished name (DN) will be found using PowerShell and the Active Directory module in this example, however PowerShell is not necessary to utilize the /replsingleobj argument.
To reproduce a domain user object, first determine the object’s DN. The DN is assigned to the PowerShell variable $UserDN in the example below. Once you have the DN, use repadmin /replsingleobject to duplicate the object from/to the source (DC01) and destination (DC02) DCs.
You’ll observe that DC01 cloned the user object to DC02 if it was successful.
$UserDN============== (Get-ADUser user1). Repadmin /replsingleobj DC01 DC02 DistinguishedName $UserDN
Using repadmin to force push replication
How to Get the Atribute ID and Version Number Related:
Sites for all DCs are being discovered.
You’ve learnt a few useful parameters for troubleshooting AD replication difficulties so far. Did you realize, though, that repadmin also provides some simple and attractive reports? The inter-site topology report is one of the most helpful reports provided by repadmin.
Repadmin creates a rudimentary report on the inter-site topology when you supply the /istg argument, which tells you which sites each DC is in. The asterisk input (*) causes the discovery to travel via all of the enterprise’s domain controllers.
/istg * repadmin
Locating Bridgehead Servers in the District of Columbia
When DCs replicate across sites, AD needs each site to have a bridgehead server, which accepts and transmits all incoming and outgoing replication requests. When troubleshooting, knowing which DCs are bridgehead servers and the state of each naming context is beneficial.
Use the /bridgeheads parameter to find bridgehead DCs and retrieve replication information for each server, as illustrated below.
/bridgeheads /verbose repadmin
The /verbose argument is an optional parameter that displays more information about the replication attempts and if they were successful.
With repadmin, you can find bridgehead servers.
Provide an asterisk as an input to the /bridgeheads option to show bridgehead servers and all other DCs, for example, repadmin /bridgeheads * /verbose.
Repadmin is a robust tool for managing and monitoring Active Directory replication that is a few years old. Repadmin includes a plethora of settings and choices for managing and reviewing replication in a variety of circumstances.
Have you ever used repadmin before? If that’s the case, do you have any valuable parameters that have assisted you in resolving a challenging replication problem?
Active Directory replication is a process that takes place on the domain controller. The process of AD replication is done manually by using the Repadmin tool. This article will provide step-by-step instructions on how to use the tool. Reference: active directory replication step by step.
Frequently Asked Questions
How do I resolve replication issues in Active Directory?
A: In Active Directory, replication is achieved through the use of Windows PowerShell cmdlets.
How do you use Repadmin?
A: The Repadmin tool can be used to administer a remote Windows computer. To use it, you must have administrator rights on the computer that is being administered and you will need an account with access to its registry hive (which varies depending on the application).
How do I monitor replication in Active Directory?
A: To monitor replication in Active Directory, you will need to use a third party tool like Microsofts System Center Operations Manager.
- repadmin all commands
- repadmin /syncall /adep means
- repadmin /replicate dc1 dc2
- repadmin replicate now
- repadmin /replsum