September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to determine if two domain controllers are in sync and have no objects to replicate to each other.
By running the following two commands you can compare the up-to-dateness vector on the two DCs:
> repadmin /showutdvec <DC1Name> <NamingContextDN> > repadmin /showutdvec <DC2Name> <NamingContextDN>
The Windows 2000 version of repadmin used a
different syntax to accomplish the same thing. Here is the equivalent
syntax:
> repadmin /showvector <NamingContextDN> <DC1Name> > repadmin /showvector <NamingContextDN> <DC2Name>
' This code prints the up-to-dateness vector for the DCs defined in ' the array arrDCList for the naming context defined by strNCDN ' ------ SCRIPT CONFIGURATION ------ ' Set to the DN of the naming context you want to check the DCs against strNCDN = "<NamingContextDN>" ' e.g. dc=amer,dc=rallencorp,dc=com ' Enter 2 or more DCs to compare arrDCList = Array("<DC1Name>","<DC2Name>") ' ------ END CONFIGURATION --------- set objIadsTools = CreateObject("IADsTools.DCFunctions") for each strDC in arrDCList WScript.Echo "Replication partner USNs for " & strDC & ":" intUSN = objIadsTools.GetHighestCommittedUSN(Cstr(strDC),0) if intUSN = -1 then Wscript.Echo "Error retrieving USN: " & objIadsTools.LastErrorText WScript.Quit end if WScript.Echo vbTab & strDC & " = " & intUSN intRes = objIadsTools.GetReplicationUSNState(Cstr(strDC), _ Cstr(strNCDN),0,0) if intRes ...