ReplicationConnection Constructor (DirectoryContext, String, DirectoryServer)

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

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

public ReplicationConnection(
	DirectoryContext context,
	string name,
	DirectoryServer sourceServer
)

Parameters

context
Type: System.DirectoryServices.ActiveDirectory.DirectoryContext

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

name
Type: System.String

The user-defined name of the connection.

sourceServer
Type: System.DirectoryServices.ActiveDirectory.DirectoryServer

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

ExceptionCondition
ActiveDirectoryOperationException

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

ActiveDirectoryServerDownException

The target server is either busy or unavailable.

ArgumentException

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.

ArgumentNullException

context or sourceServer is null.

AuthenticationException

The credentials that were supplied are not valid.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft