C# AD LDS ValidateCredentials在启用密码策略后给出false

C# AD LDS ValidateCredentials在启用密码策略后给出false,c#,adlds,local-security-policy,C#,Adlds,Local Security Policy,我正在使用AD LDS对用户进行身份验证。我面临一个问题 我有以下代码来验证用户: PrincipalContext context = new PrincipalContext(ContextType.ApplicationDirectory,xxxx, xxxx, ContextOptions.SimpleBind); auth = context.ValidateCredentials(userId, CryptoHelper.Decrypt(password), ContextOptio

我正在使用AD LDS对用户进行身份验证。我面临一个问题

我有以下代码来验证用户:

PrincipalContext context = new PrincipalContext(ContextType.ApplicationDirectory,xxxx, xxxx, ContextOptions.SimpleBind);
auth = context.ValidateCredentials(userId, CryptoHelper.Decrypt(password), ContextOptions.SimpleBind);
当本地安全策略中的密码策略被禁用时,auth返回true,而当我启用它时,它返回false


此外,只有在启用密码策略后创建的用户,身份验证才会返回false。

发现问题,当我们启用密码策略时,创建用户时msDS UserAccountDisabled设置为TRUE。因此,在创建用户的过程中,如果我们将其设置为false,它将起作用