The /ExecuteKCC switch leverages the MSAD_DomainController class's ExecuteKCC method, which, as its name suggests, forces the execution of the KCC. Among other things, the KCC calculates the replication topology (i.e., it calculates where to create the connection objects that establish the link for replication between DCs). The MSAD_DomainController class that exposes the ExecuteKCC method is a wrapper of the DsReplicaConsistencyCheck() API, so the method uses the same parameters as the API. Web Table 2 shows the values corresponding to the two method parameters, which are defined in constants at the beginning of WMIADRepl.wsf. To force KCC execution, you use the command
wmiadrepl.wsf /ExecuteKCC+
Web Listing 1 shows the ExecuteKCC method invocation.
The last switch is /SyncNC, which leverages another interesting methodthe SyncNamingContext method exposed by the MSAD_ReplNeighbor class. You can use this method to force the replication of a specific AD NC. The MSAD_ReplNeighbor class is a wrapper of the DsReplicaSync() API, so the method requires the same parameters as the API. Like the ExecuteKCC method parameters, the SyncNamingContext method parameter is defined in a constant at the beginning of WMIADRepl.wsf. Web Table 3 shows the bitwise values that you can use to turn the associated bits on and thus determine the constant value passed as a parameter of the SyncNamingContext method. To force an NC replication, you use the command
wmiadrepl.wsf /SyncNC:
CN=Configuration,DC=LissWare,
DC=Net
Web Listing 2 shows the SyncNamingContext method invocation. To retrieve the NC to synchronize, the script executes a WQL data query with the NC that you specify on the command line to locate the NC's corresponding WMI instance.
AD Gets Easier
Managing directory replication isn't an easy task, whether you use AD or another directory. In Win2K AD, KCC limitations require some companies with many sites or domains to use some Active Directory Service Interfaces (ADSI) scripts to control KCC execution. (For more information, see the Microsoft article "How to Optimize Active Directory Replication in a Large Network" at http://support.microsoft.com/?kbid=244368.) In Windows 2003, Microsoft claims that KCC can handle as many as 5000 sites (up from 300 in Win2K) in a pure Windows 2003 forest. This scalability improvement and the AD replication WMI provider increase AD's manageability.
Win2K lets you use RepAdmin to force AD replication from the command line, but Windows 2003's exposure of replication properties and methods through WMI lets you develop on top of WMI your own customized logic from any type of application (e.g., WSH script; Visual BasicVBC, C++, or Windows .NET Framework application; enterprise management software such as HP OpenView for Windows). This new provider represents a huge step forward in both AD management and programmability that every administrator and developer will be pleased to exploit.