Active Directory Domain Services Replication State Management Technology Sample

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

This sample demonstrates how to manage Active Directory replication. This sample is available only in Visual C#.

Note Note

This sample contains fictitious values and cannot be run until modified with settings for an existing domain.

For information about using the samples, see the following topics:

To customize the sample for your settings

  • Modify the following string variables with real values in the Program.cs file:

    • targetDomainName. The fully qualified name of the domain containing the servers involved in the replication.

    • targetServer. The fully qualified name of the server to use as a replication target, for example, "".

    • sourceServer. The fully qualified name of the server to use as a replication source, for example, "".

    • partitionName. The name of the partition to replicate, for example, "CN=Configuration,DC=fabrikam,DC=com".

  • To perform these operations under a user account other than the one which is running the application, you will need to replace several method calls with calls that specify the desired user and password. Replacement code is included in the sample in comments. To activate it, remove the comment characters from the replacement code and comment out the method call using default credentials that appears above it. Update the "alt-username" string to reflect the user under which the application runs, and the "alt-password" string to reflect that user's password.

To build the sample

  1. Open a Command Prompt window and navigate to the ReplicationStateManagement\CS directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.

  2. Type msbuild replicationstatemanagement.sln at the command line.

To run the sample

  1. Navigate to the directory that contains the built executable, using the command prompt.

  2. Type replicationstatemanagement and press Enter.

Note Note

This sample is a console application. You must start and run it in a Command Prompt window to view its output.

This sample performs the following replication tasks:

  • Checks replication consistency.

  • Synchronizes replication from a source server.

  • Synchronizes replication from all neighborhoods.

  • Synchronizes replication from all servers.

  • Creates new replication connections.

  • Creates a customized replication schedule.