If I want to create a new user with the UserPrincipal-class in the ADAM (Ad LDS) Directory (maybe also in Active Directory, I have not tested it), it always fails with the following message:
“The principal could not be enabled because the existing account control flags could not be read.”
The code I use is as follows:
using (UserPrincipal user = new UserPrincipal(ctx,userName,password,[false/true])) {
// ...
}