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");