Force replication to all Domain Controllers

By |2017-12-07T10:51:33+00:00November 17th, 2014|Azure, Cloud|0 Comments

My colleague and I were chatting today and noted that there’s no command to replicate changes to all domain controllers at once, you have to go to each server and force a replicate. So here’s a nifty PowerShell script to grab all the domain controllers and run a replicate sync all command for each one – so a replicate all!

Import-Module ActiveDirectory

$DCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ } | select HostName

foreach ($DC in $DCs)
        repadmin /syncall $DC.HostName

Hope it helps!

Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
Give it a try, you can unsubscribe anytime.