PowerShell command to force Active Directory replication

What is the Server 2016 PowerShell command to force Active Directory replication between domain controllers so that newly created user and computer accounts will be replicated to the other domain controllers?
IT GuyNetwork EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This previous question, looks to answer yours.
Previous EE question

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Basically with Sync-ADObject.
More specifically:
1. Choose a source DC on which to create the object, and use it with the -Server parameter when working with the New-AD... cmdlets.
2. Collect the other DCs.
3. Create the object (will be returned by the cmdlet),
4. Use the new object's DistinguishedName to replicate it to the other DCs.
## FQDN of the source DC; can be hardcoded, $ENV:ComputerName (if on a DC), randomly picked, or something like (Get-ADDomain).PDCEmulator
$Source = (Get-ADDomain).PDCEmulator
## Create a list with the rest of the DCs:
$Destination = Get-ADDomainController | Select-Object -ExpandProperty HostName | Where-Object {$_ -ne $Source}
## Now create the objects
ForEach (<Whatever>) {
	$NewObject = New-ADUser -Server $Source ...
	## Start replication of the new object from the source DC to the other DCs:
	$Destination | ForEach-Object {Sync-ADObject -Object $NewObject.DistinguishedName -Source $Source -Destination $_}

Open in new window

Or the brute force method with repadmin.exe:
## FQDN of the source DC; can be hardcoded, randomly picked, or something like (Get-ADDomain).PDCEmulator
$Source = (Get-ADDomain).PDCEmulator
## Create all the objects first:
ForEach (<Whatever>) {
	$NewObject = New-ADUser -Server $Source ...
## Then force an outbound replication:
repadmin.exe /syncall /Ped $Source "DC=domain,dc=com"

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.