Repadmin.exe – a simple command that does more. Now, we’re going to discuss about using afore said command to verify the replication and format the command output using Microsoft Excel. Repadmin.exe can be run from the elevated command prompt on all the domain controllers running Windows Server 2008 or later.
Note: Using the repadmin.exe command to check the replication is one of the possible ways. However, we can also go with Active Directory Replication Status Tool (ADREPLSTATUS) to check replication status of domain controllers. It is a UI-based alternative solution and provides us the output in a similar format with significant improvements.
To check a successful replication to a specific domain controller, we can run repadmin /showrepl. If we don’t run repadmin on the domain controller whose replication we’re checking, it is required to specify a destination domain controller in the command. Repadmin is capable of listing INBOUND NEIGHBORS for the current or specified domain controller.
In INBOUND NEIGHBORS, you can view the distinguished name of each directory partition for which inbound directory replication has been attempted. Moreover, you can also view the site and the name of the source domain controller and check if the replication is succeeded as below.
• Last attempt @ <YYYY-MM-DD HH:MM.SS> was successful.
• Last attempt @ [Never] was successful.
If you don’t see @ [NEVER] in the output for a directory partition, it means that the directory partition has never succeeded from the identified source replication partner over the listed connection. If you’re a member of Enterprise Admins or equivalent, you can complete this procedure.
How to verify a successful replication to a domain controller
1. First, we can open an elevated command prompt. On the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, provide Domain Admins credentials, if required, and then click Continue.
2. Now, it is required to type the following command and press the enter key in the command prompt.
repadmin /showrepl <servername> /u:<domainname>\<username> /pw:*
3. If you’ve logged into the domain controller or opened the Command Prompt as an administrator with the Domain Admins credentials, it isn’t required to use the user credentials parameters (/u:<domainname>\<username> /pw:*)
4. Make sure that you’re providing the credentials when you run the command for a domain controller in a different domain.
|repadmin /showrepl||Displays the replication status for the last time that the domain controller that is named in <servername> attempted inbound replication of Active Directory partitions.|
|<servername>||The name of the destination domain controller.|
|/u:||Specifies the domain name and user name, separated by a backslash, for a user who has permissions to perform operations in AD DS.|
|<domainname>||The single-label name of the domain of the destination domain controller. (You do not have to use a fully qualified Domain Name System (DNS) name.)|
|<username>||The name of an administrative account in that domain.|
|/pw:*||Specifies the domain password for the user named in <username>. * provides a Password: prompt when you press ENTER.|
5. Make sure that you’re entering the correct password at the password prompt and pressing the enter key.
At the same time, you can also use repadmin to generate the details of replication to and from all replication partners in a Microsoft Excel spreadsheet. The spreadsheet displays the data in the following columns:
Destination DC Site
Source DC Site
Number of Failures
Last Failure Time
Last Success Time
Last Failure Status
Refer to the following procedure and set the column heading for improved readability.
How to generate a repadmin /showrepl spreadsheet for all replication partners
1. As mentioned on the previous steps, it is required to open an elevated command prompt. On the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, provide Domain Admins credentials, if required, and then click Continue.
2. Now, type the following command, and then press ENTER:
repadmin /showrepl * /csv >showrepl.csv
3. Then, open Excel.
4. After that, click the Office button? click Open? navigate to showrepl.csv, and then click Open.
5. Now, hide or delete column A as well as the Transport Type column, as follows:
6. Select a column that you want to hide or delete.
o To hide the column, right-click the column, and then click Hide.
o To delete the column, right-click the selected column, and then click Delete.
7. Then, select row 1 beneath the column heading row and on the View tab, click Freeze Panes, and then click Freeze Top Row.
8. Once it is done, select the entire spreadsheet and on the Data tab, click Filter.
9. In the Last Success Time column, click the down arrow, and then click Sort Ascending.
10. In the Source DC column, click the filter down arrow, point to Text Filters, and then click the Custom Filter option.
11. In the Custom AutoFilter dialog box, under Show rows where, click does not contain.
12. After that, it is required to type “del” to eliminate from view the results for deleted domain controllers. You can perform this in the adjacent text box.
13. Once it is done, you can repeat step 12 for the Last Failure Time column. However, make sure that the value is set “Does not equal” and then type 0.
14. Now, resolve the replication failures.
For the “Intersite replication”, the last successful attempt should agree with the replication schedule. Moreover, the attempt can also be within the last hour for the “Intrasite replication”. If you find any of the following conditions from the reports of the repadmin, it is required to troubleshoot the “Active Directory Replication Problems”. We’ll discuss about troubleshooting the Active Directory Replication Problems in the subsequent articles. Now, let’s have the conditions.
• Replication was never successful.
• The last intrasite replication was longer than one hour ago.
• The last successful intersite replication was before the last scheduled replication.
This article is applicable to Windows Server 2008 and Windows Server 2008 R2.