%3CLINGO-SUB%20id%3D%22lingo-sub-329872%22%20slang%3D%22en-US%22%3EPowerShell%20Basics%3A%20How%20to%20Troubleshoot%20Active%20Directory%20Replication%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-329872%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EThere%20are%20certain%20windows%20cmdlets%20and%20utilities%20which%20we%20can%20use%20for%20replication%20issues%20troubleshooting%20purpose.%20Among%20those%2C%20%3CSTRONG%3ERepadmin.exe%3C%2FSTRONG%3E%20is%20most%20commonly%20used%20Microsoft%20utility.%20This%20is%20available%20in%20servers%20which%20have%20AD%20DS%20or%20AD%20LDS%20role%20installed.%20It%20is%20also%20part%20of%20Remote%20Server%20Administration%20Tools%20(RSAT).%20This%20utility%20recommended%20to%20run%20as%20Domain%20Administrator%20or%20Enterprise%20Administrator.%20However%2C%20it%20is%20also%20possible%20to%20delegate%20permission%20only%20to%20review%20and%20manage%20replication.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ELet%E2%80%99s%20see%20it%E2%80%99s%20in%20action%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Freplsummary%20%2Fbydest%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20summarizes%20the%20replication%20status%20for%20all%20domain%20controllers%20based%20on%20the%20replication%20destination.%20This%20parameter%20does%20not%20display%20the%20source%20domain%20controller.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Freplsummary%20%2Fbysrc%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20summarizes%20the%20replication%20status%20for%20all%20domain%20controllers%20based%20on%20the%20replication%20source.%20This%20parameter%20does%20not%20display%20the%20destination%20domain%20controller.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fshowrepl%20REBEL-SRV01.therebeladmin.com%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20shows%20the%20replication%20partners%20for%20REBEL-SRV01.therebeladmin.com%20and%20the%20status%20of%20last%20sync%20attempt.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fshowrepl%20%2Ferrorsonly%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20will%20list%20down%20the%20replication%20partners%20which%20have%20replication%20errors%20(last%20sync%20attempt%20failed)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Ewe%20also%20can%20view%20results%20in%20CSV%20format.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fshowrepl%20%2Fcsv%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71801iDBA98B0D214EEEF5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22tr1.png%22%20title%3D%22tr1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fsyncall%20REBEL-SRV01%20dc%3Dtherebeladmin%2Cdc%3Dcom%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20initiates%20domain%20directory%20partition%20synchronization%20with%20all%20replication%20partners%20of%20REBEL-SRV01.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIt%20will%20also%20indicate%20if%20there%20were%20any%20issues%20by%20doing%20it.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71802i3506EA7E84DA4B5D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22tr2.png%22%20title%3D%22tr2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fqueue%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20shows%20if%20there%20are%20any%20unprocessed%20inbound%20replications%20requests.%20If%20system%20keep%20que%20requests%20it%20can%20be%20due%20to%20high%20number%20of%20AD%20changes%2C%20System%20resource%20issue%20or%20too%20many%20replication%20partners.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Fshowchanges%20REBELNET-PDC01%20d3f89917-5fff-40a8-scc2-b148b60d9309%20dc%3Dtherebeladmin%2Cdc%3Dcom%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20list%20down%20the%20changes%20which%20are%20not%20replicated%20between%20server%20REBELNET-PDC01%20and%20REBEL-SRV01.%20In%20here%20REBEL-SRV01%20is%20the%20source%20server%20and%20it%20is%20listed%20with%20object%20GUID.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71803i16D88FC1621907A0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22tr3.png%22%20title%3D%22tr3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Erepadmin%20%2Freplicate%20REBEL-SRV01%20REBELNET-PDC01%20dc%3Dtherebeladmin%2Cdc%3Dcom%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Eabove%20command%20initiate%20immediate%20directory%20partition%20replication%20from%20REBELNET-PDC01%20to%20REBEL-SRV01.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EApart%20from%20the%20repadmin%2C%20there%20are%20certain%20PowerShell%20cmdlets%20which%20we%20can%20use%20to%20troubleshoot%20replication%20issues.%20%3CSTRONG%3EGet-ADReplicationFailure%20%3C%2FSTRONG%3Ecmdlet%20is%20one%20of%20those%20which%20can%20collect%20data%20about%20replication%20failures.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationFailure%20-Target%20REBEL-SRV01%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAbove%20command%20will%20collect%20information%20about%20replication%20failures%20associated%20with%20REBEL-SRV01.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThis%20also%20can%20do%20with%20multiple%20servers.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationFailure%20-Target%20REBEL-SRV01%2CREBELNET-PDC01%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFurther%20we%20can%20target%20all%20the%20domain%20controllers%20in%20the%20domain.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationFailure%20-Target%20%22therebeladmin.com%22%20-Scope%20Domain%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOr%20even%20entire%20forest%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationFailure%20-Target%20%22%20therebeladmin.com%22%20-Scope%20Forest%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3EGet-ADReplicationConnection%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%20cmdlet%20can%20list%20down%20replication%20partner%20details%20for%20the%20given%20domain%20controller.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationConnection%20-Filter%20*%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAbove%20command%20will%20list%20down%20all%20replication%20connection%20for%20the%20domain%20controller%20you%20logged%20in.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71804i04D9EC31ACDAB618%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22tr4.png%22%20title%3D%22tr4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20also%20can%20filter%20the%20replication%20connections%20based%20on%20the%20attributes.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet-ADReplicationConnection%20-Filter%20%7BReplicateToDirectoryServer%20-eq%20%22REBEL-SRV01%22%7D%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAbove%20command%20will%20list%20down%20the%20replication%20connections%20with%20destination%20server%20as%20REBEL-SRV01.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20also%20can%20force%20sync%20object%20between%20domain%20controllers.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESync-ADObject%20-object%20%E2%80%9Cadam%E2%80%9D%20-source%20REBEL-SRV01%20-destination%20REBELNET-PDC01%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAbove%20command%20will%20sync%20user%20object%20adam%20from%20REBEL-SRV01%20to%20REBELNET-PDC01%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-329872%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EThere%20are%20certain%20windows%20cmdlets%20and%20utilities%20which%20we%20can%20use%20for%20replication%20issues%20troubleshooting%20purpose.%20Among%20those%2C%20%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3ERepadmin.exe%3C%2FSTRONG%3E%20is%20most%20commonly%20used%20Microsoft%20utility.%20This%20is%20available%20in%20servers%20which%20have%20AD%20DS%20or%20AD%20LDS%20role%20installed.%20It%20is%20also%20part%20of%20Remote%20Server%20Administration%20Tools%20(RSAT).%20This%20utility%20recommended%20to%20run%20as%20Domain%20Administrator%20or%20Enterprise%20Administrator.%20However%2C%20it%20is%20also%20possible%20to%20delegate%20permission%20only%20to%20review%20and%20manage%20replication.%3C%2FSPAN%3E%20This%20posts%20will%20share%20the%20steps%20to%20make%20this%20happen%20via%20PowerShell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F72395i3236BC54F546B29E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22PowerShell_Basics.jpg%22%20title%3D%22PowerShell_Basics.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-329872%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDishan%20Francis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

There are certain windows cmdlets and utilities which we can use for replication issues troubleshooting purpose. Among those, Repadmin.exe is most commonly used Microsoft utility. This is available in servers which have AD DS or AD LDS role installed. It is also part of Remote Server Administration Tools (RSAT). This utility recommended to run as Domain Administrator or Enterprise Administrator. However, it is also possible to delegate permission only to review and manage replication.

 

Let’s see it’s in action

 

repadmin /replsummary /bydest

 

above command summarizes the replication status for all domain controllers based on the replication destination. This parameter does not display the source domain controller.

 

repadmin /replsummary /bysrc

 

above command summarizes the replication status for all domain controllers based on the replication source. This parameter does not display the destination domain controller.

 

repadmin /showrepl REBEL-SRV01.therebeladmin.com

 

above command shows the replication partners for REBEL-SRV01.therebeladmin.com and the status of last sync attempt.

 

repadmin /showrepl /errorsonly

 

above command will list down the replication partners which have replication errors (last sync attempt failed)

 

we also can view results in CSV format.

 

repadmin /showrepl /csv

 

tr1.png

 

repadmin /syncall REBEL-SRV01 dc=therebeladmin,dc=com

 

above command initiates domain directory partition synchronization with all replication partners of REBEL-SRV01.

 

It will also indicate if there were any issues by doing it.

 

tr2.png

 

repadmin /queue

 

above command shows if there are any unprocessed inbound replications requests. If system keep que requests it can be due to high number of AD changes, System resource issue or too many replication partners.

 

repadmin /showchanges REBELNET-PDC01 d3f89917-5fff-40a8-scc2-b148b60d9309 dc=therebeladmin,dc=com

 

above command list down the changes which are not replicated between server REBELNET-PDC01 and REBEL-SRV01. In here REBEL-SRV01 is the source server and it is listed with object GUID.

 

tr3.png

 

repadmin /replicate REBEL-SRV01 REBELNET-PDC01 dc=therebeladmin,dc=com

 

above command initiate immediate directory partition replication from REBELNET-PDC01 to REBEL-SRV01.

 

Apart from the repadmin, there are certain PowerShell cmdlets which we can use to troubleshoot replication issues. Get-ADReplicationFailure cmdlet is one of those which can collect data about replication failures.

 

Get-ADReplicationFailure -Target REBEL-SRV01

 

Above command will collect information about replication failures associated with REBEL-SRV01.

This also can do with multiple servers.

 

Get-ADReplicationFailure -Target REBEL-SRV01,REBELNET-PDC01

 

Further we can target all the domain controllers in the domain.

 

Get-ADReplicationFailure -Target "therebeladmin.com" -Scope Domain

 

Or even entire forest

 

Get-ADReplicationFailure -Target " therebeladmin.com" -Scope Forest

 

Get-ADReplicationConnection cmdlet can list down replication partner details for the given domain controller.

 

Get-ADReplicationConnection -Filter *

 

Above command will list down all replication connection for the domain controller you logged in.

 

tr4.png

 

We also can filter the replication connections based on the attributes.

 

Get-ADReplicationConnection -Filter {ReplicateToDirectoryServer -eq "REBEL-SRV01"}

 

Above command will list down the replication connections with destination server as REBEL-SRV01.

We also can force sync object between domain controllers.

 

Sync-ADObject -object “adam” -source REBEL-SRV01 -destination REBELNET-PDC01

 

Above command will sync user object adam from REBEL-SRV01 to REBELNET-PDC01