Active Directory Services: PrincipalContext -- What is the DN of a "container" object?

Posted by Ranger Pretzel on Stack Overflow See other posts from Stack Overflow or by Ranger Pretzel
Published on 2010-03-29T13:10:46Z Indexed on 2010/03/29 13:13 UTC
Read the original article Hit count: 1161

I'm currently trying to authenticate via Active Directory Services using the PrincipalContext class. I would like to have my application authenticate to the Domain using Sealed and SSL contexts. In order to do this, I have to use the following constructor of PrincipalContext (link to MSDN page):

public PrincipalContext(
    ContextType contextType,
    string name,
    string container,
    ContextOptions options
)

Specifically, I'm using the constructor as so:

PrincipalContext domainContext = new PrincipalContext(
    ContextType.Domain, 
    domain, 
    container, 
    ContextOptions.Sealing | ContextOptions.SecureSocketLayer);

MSDN says about "container":

The container on the store to use as the root of the context. All queries are performed under this root, and all inserts are performed into this container. For Domain and ApplicationDirectory context types, this parameter is the distinguished name (DN) of a container object.

What is the DN of a container object? How do I find out what my container object is? Can I query the Active Directory (or LDAP) server for this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .net-3.5