Trigger and Verify Full Active Directory Replication with PowerShell

In distributed Active Directory environments, it can be useful to manually trigger replication after changes to Group Policies, user objects, or DNS records. This PowerShell script automates that process across all domain controllers and then checks the replication status afterwards. repadmin /syncall is the underlying command used to synchronize domain controllers, and Get-ADReplicationPartnerMetadata is used to read replication partner information.

What the script does

The script performs three steps. First, it collects all domain controllers in the current domain. Then it triggers replication on each of them. Finally, it waits briefly and displays the current replication partner status so you can quickly see whether replication completed successfully.

Requirements

  • Active Directory PowerShell module installed.
  • Domain Administrator privileges.
  • Connectivity to all domain controllers.

Practical notes

The /e switch in repadmin /syncall synchronizes domain controllers across all sites in the enterprise, while /A includes all naming contexts held on the server. A short delay before checking status is helpful because replication may still be in progress when the command finishes.

GitHub download

Download the script here: Force-ADReplication.ps1.

Schreibe einen Kommentar