This project has moved and is read-only. For the latest updates, please go here.

how to change code LDAPCP in multiple trusts (SPTrustedIdentityTokenIssuer objects), so that People Picker retrieve users from two different ADFS Server

Aug 23, 2015 at 4:14 AM
Edited Aug 23, 2015 at 4:25 AM
Hi Team,

we implemented & deployed LDAPCP and associated with one SPTrustedIdentityTokenIssuer(ABC Adfs Domain Users), which is working fine.

The Sharepoint people picker is retrieving XYZ Domain users. Thanks for the code.

Now we just added another SPTrustedIdentityTokenIssuer(XYZ Adfs Domain Users).

we have modified the Solution file in the below code of the LDAPCP for Developers and Deployed in the Central admin.

Is this way to add multiple trust in the custom code.

Custom Code:

protected override DirectoryEntry[] SetLDAPConnections(Uri context, string[] entityTypes)
 return new DirectoryEntry[] { 
 //Domain.GetComputerDomain().GetDirectoryEntry(),     // Same AD as SharePoint server
new DirectoryEntry ("LDAP://","Admin", "P@ssw0rd"),   // ABC LDAP server
new DirectoryEntry ("LDAP://","Admin123", "P@ssw0rd"), // XYZ LDAP server
Need your suggestion and help on how to proceed further.

A link with steps would be much helpful.

Thanks in advance.
Aug 24, 2015 at 5:08 PM
you don't need to edit LDAPCP class.
You should download package for developers in "Downlodas" section and check sample classes that show you how to do that. Basically you just need to inherit LDAPCP and override a few methods and properties.
Aug 25, 2015 at 3:43 AM
Thanks Yvand for your valuable suggestion and advice, I just downloaded developers package- LDAPCP Custom.wsp. I just implemented first time in this code.
So Can you please guide me where I have to inherit another LDAP connection (XYZ LDAP Server) and override the methods and properties on that code.
Sep 1, 2015 at 2:41 PM
You can check class "LDAPCP_Custom", it shows simple possible customizations, including custom LDAP connection by overriding method SetLDAPConnections.