ConnectionManager.AddActiveDirectoryConnection Method (ConnectionType, String, String, Boolean, String, String, SecureString, List<DirectoryServiceNamingContext>, String, String, String)
Adds an Active Directory connection for the current service context.
Namespace: Microsoft.Office.Server.UserProfiles
Assembly: Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
Syntax
'Declaration
Public Function AddActiveDirectoryConnection ( _
type As ConnectionType, _
displayName As String, _
server As String, _
useSSL As Boolean, _
accountDomain As String, _
accountUsername As String, _
accountPassword As SecureString, _
namingContexts As List(Of DirectoryServiceNamingContext), _
spsClaimProviderTypeValue As String, _
spsClaimProviderIdValue As String, _
adClaimIDMapAttribute As String _
) As DirectoryServiceConnection
'Usage
Dim instance As ConnectionManager
Dim type As ConnectionType
Dim displayName As String
Dim server As String
Dim useSSL As Boolean
Dim accountDomain As String
Dim accountUsername As String
Dim accountPassword As SecureString
Dim namingContexts As List(Of DirectoryServiceNamingContext)
Dim spsClaimProviderTypeValue As String
Dim spsClaimProviderIdValue As String
Dim adClaimIDMapAttribute As String
Dim returnValue As DirectoryServiceConnection
returnValue = instance.AddActiveDirectoryConnection(type, _
displayName, server, useSSL, accountDomain, _
accountUsername, accountPassword, _
namingContexts, spsClaimProviderTypeValue, _
spsClaimProviderIdValue, adClaimIDMapAttribute)
public DirectoryServiceConnection AddActiveDirectoryConnection(
ConnectionType type,
string displayName,
string server,
bool useSSL,
string accountDomain,
string accountUsername,
SecureString accountPassword,
List<DirectoryServiceNamingContext> namingContexts,
string spsClaimProviderTypeValue,
string spsClaimProviderIdValue,
string adClaimIDMapAttribute
)
Parameters
type
Type: Microsoft.Office.Server.UserProfiles.ConnectionTypeAn enumeration value that specifies the connection type.
displayName
Type: System.StringThe display name of the connection.
server
Type: System.StringThe server associated with the connection.
useSSL
Type: System.Booleantrue to use SSL encryption for the connection; otherwise, false.
accountDomain
Type: System.StringThe domain name associated with the connection credentials.
accountUsername
Type: System.StringThe user name associated with the connection credentials.
accountPassword
Type: System.Security.SecureStringThe user password associated with the connection credentials.
namingContexts
Type: System.Collections.Generic.List<DirectoryServiceNamingContext>The directory service naming contexts associated with the connection.
spsClaimProviderTypeValue
Type: System.StringThe type for the claims provider definition.
spsClaimProviderIdValue
Type: System.StringThe ID of the claims provider for SharePoint Server.
adClaimIDMapAttribute
Type: System.StringThe claim ID map attribute for Active Directory.
Return Value
Type: Microsoft.Office.Server.UserProfiles.DirectoryServiceConnection
The Active Directory connection for the current service context.
Exceptions
Exception | Condition |
---|---|
DuplicateEntryException | The service context already has a connection with the same name as displayName. |
Remarks
This method adds an Active Directory connection for the current service context. See User profile property data types for a table that lists the Active Directory Domain Services (AD DS) data types and the .NET data types that are compatible with the data types of SharePoint 2010 user profile properties. Also see Connection filter data types and operators for a table that lists the operators that are available for each Active Directory Domain Services (AD DS) data type.