By David Wiseman (Administrator)Created 24 Feb 2008
My Rating:
Vote
Rating:
Not Rated
Views:6701
Downloads:206

Monitor Active Directory Replication

Language:  VBScript

Compatibility

Windows XP No Windows 2003 Yes
Windows 2000 No Windows NT No
Vista Unknown Windows 2008 Unknown
Description

Returns a list of pending replication jobs on a domain controller.

Code

Line Numbers: On  Off      Plain Text
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & _
        strComputer & "\root\MicrosoftActiveDirectory")

Set colReplicationOperations = objWMIService.ExecQuery _
        ("Select * from MSAD_ReplPendingOp")

If colReplicationOperations.Count = 0 Then
    Wscript.Echo "There are no replication jobs pending."
    Wscript.Quit
Else
    For each objReplicationJob in colReplicationOperations 
        Wscript.Echo "Serial number: " & objReplicationJob.SerialNumber
        Wscript.Echo "Time in queue: " & objReplicationJob.TimeEnqueued
        Wscript.Echo "DSA DN: " & objReplicationJob.DsaDN
        Wscript.Echo "DSA address: " & objReplicationJob.DsaAddress
        Wscript.Echo "Naming context DN: " & objReplicationJob.NamingContextDn
    Next
End If

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
Be the first to post a comment!