Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help
in Search

Constructing a PrincipalContext with a DN for the username

Last post 03-03-2011, 3:44 PM by utup. 0 replies.
Sort Posts: Previous Next
  •  02-28-2011, 8:56 AM 8897

    Constructing a PrincipalContext with a DN for the username

    When I create a PrincipalContext with a DN for the username, I get a “A local error has occurred” exception when I try to do a FindByIdentity with that PrincipalContext. Can I use a DN here?

    Based on Figure 3 in Joe Kaplan and Ethan Wilansky’s paper on AccountManagement (http://msdn.microsoft.com/en-us/magazine/cc135979.aspx), it would seem as if using a DN should work in the constructor (but their example is for AD LDS which we are not using):

    PrincipalContext ldsContext = new PrincipalContext(
    ContextType.ApplicationDirectory, "sea-dc-02.fabrikam.com:50001",
    "ou=ADAM Users,o=microsoft,c=us",
    ContextOptions.SecureSocketLayer | ContextOptions.SimpleBind,
    "CN=administrator,OU=ADAM Users,O=Microsoft,C=US ", "pass@1w0rd01");
View as RSS news feed in XML