Powershell or VB codes to replicate between DC
Any script that we can use to replicate between Dc's.
I want to force replicate Can anyone help me with a script preferably Powershell or VBS.
Any script that we can use to replicate between Dc's.
I want to force replicate Can anyone help me with a script preferably Powershell or VBS.
Here is a script that can be used to force replicate between your domain controllers.
$domain = "Domain.local"
$servers = "Dc1","Dc2","DC3","DC4"
$context = new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Domain",$domain)
$dclist = [System.DirectoryServices.ActiveDirectory.DomainController]::findall($context)
foreach($srv in $servers)
{
   Write-Host "Force Replicate on $Srv"
   $dc = $dclist | ?{$_.Name -match $srv}
   $dc.SyncReplicaFromAllServers(([ADSI]"").distinguished Name,'CrossSite')
}
Let me know if you would need a VBS solution so can write a short script to do it.
Â