using(PrincipalContext cntx = new PrincipalContext(
ContextType.Domain, "blah.corp.net:389", "OU=customers,OU=web,CN=blah,CN=corp,CN=net",
ContextOptions.Negotiate, "Domin\Admin", "{Password}")){
string password = "PPaass00!!";
UserPrincipal p = new UserPrincipal(cntx);
p.SamAccountName = "GuestUser";
p.PasswordNeverExpires = true;
p.Enabled = true;
p.SetPassword(password);
p.Save();
bool b = cntx.ValidateCredentials("GuestUser", password); //where b always false
}
我不明白为什么 b 总是假的。任何人都可以帮忙吗?