Perhaps you’re creating a user for immediate use in another site. Perhaps you’ve updated a group membership and accidentally used a DC in the wrong site. Maybe you’re just lazy? One of the most fun (read: boring) parts of Active Directory cross-site administration is replication. Opening up Active Directory Sites & Services and mindlessly clicking Replicate Now gets painful, and begs the question of “how can I do this faster?”. Along came Polly…That is, if by Polly you mean repadmin.exe.
Repadmin is the hidden treasure of AD-DS replication. It allows you to replicate a connection simply by executing two simple commands:
repadmin /kcc MEL-DC01 MEL-DC02 SYD-DC01 repadmin /syncall /A /e MEL-DC01
This is easy enough, but when you have more than three or four Active Directory domain controllers it, again, feels slow. Along came PowerShell. In the script below I use Quest’s ActiveRoles Active Directory Management Snap-in to find all domain controllers in the current domain and then replicate the connections to/from them all.
Once we have a list of DCs, it is possible to loop through each then recalculate the replication topology and then replicate the connections. This performs the same task as clicking Replicate Now in
There's no commenting functionality here. If you'd like to comment, please either mention me (@firstname.lastname@example.org) on Mastodon or email me. I don't have any logging or analytics running on this website, so if you found something useful or interesting it would mean a lot to hear from you.