Returns a list of pending replication jobs on a domain controller
strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & _strComputer & "\root\MicrosoftActiveDirectory")Set colReplicationOperations = objWMIService.ExecQuery _("Select * from MSAD_ReplPendingOp")If colReplicationOperations.Count = 0 ThenWscript.Echo "There are no replication jobs pending."Wscript.QuitElseFor each objReplicationJob in colReplicationOperationsWscript.Echo "Serial number: " & objReplicationJob.SerialNumberWscript.Echo "Time in queue: " & objReplicationJob.TimeEnqueuedWscript.Echo "DSA DN: " & objReplicationJob.DsaDNWscript.Echo "DSA address: " & objReplicationJob.DsaAddressWscript.Echo "Naming context DN: " & objReplicationJob.NamingContextDnNextEnd If
This is a VB Script, this can be used by saving the file in .vbs file