ReplicationConnection Constructor (DirectoryContext, String, DirectoryServer, ActiveDirectoryTransportType)

 

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

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

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

Parameters

context
Type: System.DirectoryServices.ActiveDirectory.DirectoryContext

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

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.

transport
Type: System.DirectoryServices.ActiveDirectory.ActiveDirectoryTransportType

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

Exception Condition
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.

InvalidEnumArgumentException

transport is not a valid ActiveDirectoryTransportType value.

NotSupportedException

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

.NET Framework
Available since 2.0
Return to top
Show: