Limit LDAP queries to a single OU RRS feed

  • Question

  • User1905037865 posted

    Can anyone tell me how to limit queries LDAP against AD to a single OU? Meaning I do not want users to be able to get results from any other OU's  just the one I give them access too. I have Mac users who can see the entire directory and I don't want them to see results except in the one OU; I figure this must be permissions related but how do I configure it?


    Wednesday, January 23, 2013 3:15 PM

All replies

  • User1508394307 posted

    When searching you can specify OU in DirectoryEntry

    DirectoryEntry rootEntry = new DirectoryEntry("...OU=XXX...");

    or use DirectorySearcher.Filter

    DirectorySearcher ds = new DirectorySearcher(rootEntry);
    ds.Filter = "...";

    Saturday, February 23, 2013 4:18 AM