Most AD directors use the repadmin (appeared in Windows Server 2003) and replmon (have to be copied from Support Tool for WS2003) console instruments to observe and management Active Directory replication. In Windows Server 2012, Microsoft added quite a lot of PowerShell cmdlets to handle and test replication standing within the Active Directory forest. In this text we’ll have a look at the primary helpful PoSh cmdlets that an AD administrator can use to regulate replication between area controllers.
The cmdlets for managing and monitoring AD replication are part of Active Directory Module for Windows PowerShell. You can allow it on the desktop Windows editions after RSAT set up. To import the module right into a PowerShell session, run this command:
Note. Active Directory Module for PowerShell is mechanically imported on the area controllers ranging from Windows Server 2012 R2 or later.
You can show the complete listing replication-related cmdlets within the ActiveDirectory module as follows:
get-command -module activedirectory -name *ADReplicat*
To acquire the details about replication failures for the precise area controller, use the Get-ADReplicationFailure cmdlet:
Get-ADReplicationFailure -Target DC1
If there are not any errors, the cmdlet will return nothing. Otherwise, you will note the listing of failed objects and the causes of replication errors.
You can question a number of DCs directly:
Get-ADReplicationFailure -Target DC1,DC2
In this case, you may see that there was the area controller dc2 (hyperlink failure) connection drawback on February, 22, however there are not any errors in the meanwhile.
To shortly get the replication standing for all DCs on the desired web site:
Get-ADReplicationFailure -scope web site -target Madrid | FT Server, LastError, Partner-Auto
Or for all area controllers within the area or within the forest (-Scope Forest):
Get-ADReplicationFailure -Target "woshub.com" -Scope Domain
Get-ADReplicationConnection cmdlet is used to show details about the replication companions for the present area controller.
Get-ADReplicationConnection -Filter *
If you need to show the replication connections for the precise DC, run this command:
To drive synchronization of the precise object between area controllers, Sync-ADObject cmdlet is used. For instance, let’s take into account the case when an AD object has been deleted, moved to the AD Recycle Bin after which restored. After the item has been restored, you may drive replication of the recovered object to all area controllers utilizing Sync-ADObject cmdlet:
Get-ADDomainController -filter * | foreach
Get-ADReplicationPartnerMetadata cmdlet permits getting details about the replication of metadata between DCs and companions. For instance, to get the details about the time of the final attempt to carry out replication with a accomplice and the time of the final profitable replication for all DCs, enter the next command:
Get-ADReplicationPartnerMetadata -Target "$env:userdnsdomain" -Scope Domain | Select-Object Server, FinalReplicationTry, FinalReplicationSuccess, Partner
You can get the replication standing of a sure object:
Get-ADReplicationAttributeMetadata -Object "CN=Maggie Skosana,OU=Users,DC=woshub,DC=com" -Server DC1
Using Get-ADReplicationQueueOperation cmdlet, you may get the listing of pending replication operations on the precise server.
Get-ADReplicationUpToDatenessVectorTable cmdlet permits to get the listing of USN values for replication companions:
Get-ADReplicationUpToDatenessVectorTable * | ft Partner,Server,UsnFilter
Thus, PowerShell is a robust and handy software for replication monitoring and troubleshooting within the AD forest, which is usually a 100% substitute for repadmin within the Active Directory replication administration duties.