Multiple namingContexts

Jul 10, 2014 at 11:56 AM
Edited Jul 10, 2014 at 1:56 PM

I have successfully queried AD for a particular OU via the namingContext Parameter. However, I need to include another OU within AD - how do I go about selecting multiple OU's

I'm presuming I need to provide two or more namingContexts?




I've tried using the LdapConfiguration and adding multiple mappings.
config.AddMapping(new UserMap1(), "usermap1NamingContext"); // this is dealing with one region of the Active Directory
config.AddMapping(new UserMap2(), "usermap2NamingContext"); // this is dealing with another region of the Active Directory
However, this works but only against the first mapping provided. I'm guessing because it's a dictionary it is only allowing one of the same mapping type to be added?
public class UserMap1: ClassMap<User>
public class UserMap2: ClassMap<User>
Jul 13, 2014 at 2:53 AM
Hi Mark,

I'm not sure if this is possible, but you may be able to map the class once, and then use the filter to specify which OU you want to search within. Please see this stackoverflow post.