Subscribe to Windows IT Pro
December 08, 2003 12:00 AM

Using WMI to Manage AD Replication in Windows Server 2003

Manage AD replication with WMIADRepl.wsf
Windows IT Pro
InstantDoc ID #40881
Rating: (2)
Downloads
40881.zip

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 method—the 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 Basic—VB—C, 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.

Related Content:

ARTICLE TOOLS

Comments
  • KHALED
    5 years ago
    Feb 13, 2007

    I need WMIADRepl.vbs not WSF. can you post the vbs. Thanks.

  • KHALED
    5 years ago
    Feb 13, 2007

    The downloadable code seems to be missing the supporting .vbs files. Can you repost them please.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.