When it comes to an Active Directory environment, AD replication is important and critical. Changes made on one domain controller are replicated across other domain controllers, either within the same AD forest or domain. This process is important for maintaining consistency in user data (attributes), group policies, and other directory objects throughout the organization’s network. Although AD replication occurs automatically by design when a new domain controller is added, but administrators have the ability to customize the replication process to meet specific network or organizational requirements.
Files Involved in AD Replication:
- NTDS.dit:
- This is the main database file that stores all AD data (users, groups, security policies, etc.). It is the file replicated between domain controllers.
- EDB.log (Log Files):
- These are the transaction log files for the NTDS.dit database. Changes to AD are first recorded in the log files before being written to the main database. These log files are used in case of recovery and are involved in the replication process to ensure no data is lost.
- SYSVOL Folder:
- SYSVOL is a shared directory that contains important AD data, such as Group Policy Objects (GPOs) and logon scripts. This folder is replicated between domain controllers in a domain using File Replication Service (FRS) or Distributed File System Replication (DFSR).
- NTFRS or DFSR (depending on the replication model):
- NTFRS (File Replication Service) was used in earlier versions of Windows Server for SYSVOL replication. In modern versions, DFSR (Distributed File System Replication) is used to replicate SYSVOL.
Ports Used in AD Replication:
AD replication depends on several ports and protocols for communication between domain controllers. The main ports involved are:
- RPC (Remote Procedure Call):
- Port 135: Used by RPC Endpoint Mapper for initial contact between DCs.
- Dynamic RPC Ports: Ports in the range 49152-65535 (by default, these ports are dynamically assigned) are used for the actual RPC communication during replication.
- LDAP (Lightweight Directory Access Protocol):
- Port 389: Used for LDAP communication between domain controllers during normal directory queries and updates. It is also used by AD for replication.
- Port 636: Used for LDAP over SSL (LDAPS) to encrypt communication.
- Kerberos:
- Port 88: Used by the Kerberos authentication protocol for domain authentication. This is not directly related to replication but is important for overall AD communication.
- DNS:
- Port 53: DNS (Domain Name System) is essential for AD to locate domain controllers and establish communication during replication.
- SMB (Server Message Block):
- Port 445: Used for SMB traffic. This protocol is used for file and printer sharing, but also plays a role in AD replication, particularly for SYSVOL replication (which stores group policy data).
Monitoring health of AD Replication.
Monitoring the health of Active Directory (AD) replication is important to ensure that all domain controllers remain synchronized and that directory data is accurately replicated. Below are several tools and PowerShell commands that can be used during troubleshooting. While third-party monitoring tools are available to monitor the health of AD environments, PowerShell is highly effective for live monitoring and troubleshooting.
1. Use Repadmin Tool
- repadmin /replsummary: This provides a summary of replication health, showing failed replication attempts, the last replication time, and problematic domain controllers.
- repadmin /showrepl DC: This command provides detailed information about the replication status for a specific domain controller.
- repadmin /syncall DC /A /P /e /d: Forces replication and shows detailed results.
2. Use PowerShell Cmdlets : These days PowerShell is very important to know detail information without manually checking below are important commands.
- Get-ADReplicationPartnerMetadata: Retrieves detailed replication metadata, including the status and errors for a domain controller.
- Get-ADReplicationFailure: Displays a list of replication failures, helping to identify the root cause of replication issues.
3. Use DCDiag Tool
- The DCDiag tool performs a high-level diagnostic check across all domain controllers. Run dcdiag /test:replications to specifically check for replication issues, and dcdiag /v for verbose output.
4. Use Event Viewer
- Monitoring is very essential and always start Event Viewer for replication errors or warnings (e.g., Event IDs 1311, 1865). These events will give insights into underlying issues like DNS, network problems, hardware etc.
5. Use monitoring tool like System Center Operations Manager (SCOM)
- For large-scale enterprise environments, should be advanced monitoring of AD replication health and can generate automatic alerts for issues and then notification via email or ticketing system.
PowerShell commands for AD Replication Monitoring
PowerShell offers several commands to monitor and troubleshoot AD replication. Actively monitor and troubleshoot replication using PowerShell cmdlets rather than relying on graphical interfaces or third-party tools. FYI, Here DC representing my domain controller name. You can put your domain controller name.
- Get-ADReplicationPartnerMetadata
- Displays the replication metadata for a specific domain controller, including the last replication time and status.
Example: Get-ADReplicationPartnerMetadata -Target “DC”
- Displays the replication metadata for a specific domain controller, including the last replication time and status.
- Get-ADReplicationFailure
- Shows replication failures for a domain controller, including error messages and timestamps.
Example: Get-ADReplicationFailure -Target “DC”
- Shows replication failures for a domain controller, including error messages and timestamps.
- Sync-ADObject
- Forces replication of a specific AD object across domain controllers.
Example: Sync-ADObject -Object “CN=tnegi,OU=HR,DC=lab,DC=com” -Source DCname-Destination dcname
- Forces replication of a specific AD object across domain controllers.
- Get-ADReplicationSiteLink
- Displays the properties of site links (paths for replication) in the AD environment.
Example: Get-ADReplicationSiteLink
- Displays the properties of site links (paths for replication) in the AD environment.
- Get-ADReplicationPartner
- Lists replication partners for a given domain controller.
Example: Get-ADReplicationPartnerMetadata -Target domaincontrollername
- Lists replication partners for a given domain controller.
- Get-ADReplicationConnection
- Displays the replication connections between domain controllers.
Example: Get-ADReplicationConnection -Server “DC”
- Displays the replication connections between domain controllers.
- Test-ADReplicationHealth
- Performs a health check on a specific domain controller’s replication health.
Example: Test-ADReplicationHealth -Target “DC”
- Performs a health check on a specific domain controller’s replication health.
- Get-ADReplicationAttributeMetadata
- Shows when the last replication occurred for a specific object.
Example: Get-ADReplicationAttributeMetadata -Object “CN=tnegi,OU=HR,DC=lab,DC=com” -Server “DC”
- Shows when the last replication occurred for a specific object.
- sometime Force Replication is very important for that we have to use Repadmin
- A legacy tool that can also be used within PowerShell to force replication.
Example: repadmin /syncall /A /P /e /d
- A legacy tool that can also be used within PowerShell to force replication.
Common AD Replication Issues and Fixes
Below are some common issues and solutions related to AD replication:
- Replication Latency:
- Causes: Network congestion, incorrect site link configurations.
- Solution: Adjust replication schedules, optimize site link costs, and ensure proper network performance.
- Replication Failures Due to DNS:
- Causes: Incorrect DNS settings, missing DNS records.
- Solution: Verify DNS configuration, ensure correct SRV records exist, and make sure all domain controllers use the proper DNS server.
- Time Synchronization Issues:
- Causes: Out-of-sync time settings between domain controllers.
- Solution: Ensure all domain controllers are synchronized to a reliable time source (e.g., using NTP or the W32Time service).
- Network Connectivity Issues:
- Causes: Firewalls blocking required ports, misconfigured routers.
- Solution: Verify network routes, ensure required ports (e.g., LDAP, RPC) are open, and troubleshoot any firewall or routing issues.
- please refer below link for port check : Verify Network Ports on a Domain Controller – dbtuhub.com
- Repadmin and DCDiag Errors:
- Causes: Stale replication links, incomplete replication topology.
- Solution: Review replication status using Repadmin and DCDiag, reset any failed connections, and manually force replication if necessary.
Troubleshooting AD Replication
Replication failures or delays can have significant impacts on AD operations, including issues like user logins, authentication, and group policies. Below are the few steps to troubleshoot replication issues:
1. Check Replication Status
- Use the Repadmin tool to monitor replication health and status. Some commonly used commands include:
- repadmin /replsummary: This provides an overview of the replication status for all domain controllers in the forest.
- repadmin /showrepl: Displays detailed replication status for each domain controller, showing information like the last successful replication time, errors, and replication partners.
- repadmin /syncall: Forces immediate replication between all domain controllers.
2. Use Event Logs
- Replication issues often generate errors in the Event Viewer logs. Specifically, look under Applications and Services Logs > Directory Service for replication-related events.
- Key event IDs to look for:
- Event ID 1311: Indicates a general replication failure.
- Event ID 1865: Represents replication problems related to DNS.
- Event ID 2042: Shows problems with replication between domain controllers.
3. Verify DNS Configuration
- Since DNS is critical for AD replication, ensure that DNS settings are correct. If domain controllers cannot resolve each other’s names, replication will fail.
- Use the nslookup tool to verify DNS records.
- Ensure that all domain controllers are using the correct DNS servers, and that their SRV (service locator) records are up-to-date.
4. Check Network Connectivity
- Replication failures can be caused by network connectivity issues. Verify that domain controllers can communicate with one another over the network.
- Use tools like ping, telnet, or netstat to check connectivity.
- Ensure that required ports for replication are open (e.g., 389 (LDAP), 636 (LDAPS), and others used by AD replication).
5. Check Time Synchronization
- Significant time differences between domain controllers can prevent replication from occurring properly.
- Use the Windows Time Service (W32Time) to ensure that all domain controllers have synchronized clocks.
- You can check the system time with the net time or w32tm command.

6. Check Active Directory Sites and Services
- In Active Directory Sites and Services, ensure that domain controllers are correctly assigned to their respective sites. Also, verify that replication schedules are set appropriately and that site links are properly configured.
7. Force Replication
- If replication fails or is delayed, you can force replication using the Repadmin /syncall command or by manually triggering replication in the Active Directory Sites and Services console.
8. Use Dcdiag Tool
- The DCDiag tool performs a diagnostic check of domain controllers and can identify issues with replication and other critical AD functions.
- Use the command dcdiag /test:replications to test replication across all domain controllers in the forest. This will display the test results and indicate if there are any issues with any existing server, showing which server failed and when.
Best Practices for AD Replication Monitoring
- Regular Checks: Regularly check replication status using tools like Repadmin or Automate replication health checks and set up alerts for early detection of issues.
- Network Optimization: Ensure site links and replication schedules are optimized for performance.
- Comprehensive Monitoring: Implement monitoring solutions like SCOM for detailed, enterprise-wide AD replication health tracking.