ReplicationConnection Constructor (DirectoryContext, String, DirectoryServer, ActiveDirectorySchedule, ActiveDirectoryTransportType)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of the ReplicationConnection class, using the specified context, name, source server, schedule, and transport type.

Namespace:   System.DirectoryServices.ActiveDirectory
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

public ReplicationConnection(
	DirectoryContext context,
	string name,
	DirectoryServer sourceServer,
	ActiveDirectorySchedule schedule,
	ActiveDirectoryTransportType transport


Type: System.DirectoryServices.ActiveDirectory.DirectoryContext

A DirectoryContext object that contains the target and credentials with which to establish a replication connection.

Type: System.String

The user-defined name of the connection.

Type: System.DirectoryServices.ActiveDirectory.DirectoryServer

A DirectoryServer object that identifies the source server of the connection.

Type: System.DirectoryServices.ActiveDirectory.ActiveDirectorySchedule

A ActiveDirectorySchedule object that specifies when the source is available for replication.

Type: System.DirectoryServices.ActiveDirectory.ActiveDirectoryTransportType

One of the ActiveDirectoryTransportType members that specifies the transport type of the connection.

Exception Condition

A call to the underlying directory service resulted in an error.


The target server is either busy or unavailable.


This exception will occur for any one of the following reasons:

  • The target of the context parameter is not a domain controller or AD LDS instance.

  • sourceServer is invalid or an empty string.

  • The target specified in the context parameter does not match the server type specified in the sourceServer parameter. The servers must both be either domain controllers or AD LDS instances.

  • The servers specified in the context and sourceServer parameters are domain controllers, but are not in the same forest.

  • The servers specified in the context and sourceServer parameters are AD LDS instances, but do not belong to the same configuration set.


context, sourceServer or schedule is null.


The credentials that were supplied are not valid.


transport is not valid.


context is an AD LDS instance and transport is Smtp, which is not supported.

.NET Framework
Available since 2.0
Return to top