Change user password in ADS and check the password policy?



Hi, im creating a app where the user can change his password, so far so good.
Now, we have on our domain a password policy which means that passwords are stored 12 time, the password must be changed on every 60 days and uses complex passwords etc...

But if i change the password to the same password, i can do that without any "error" message!?!?

How can i archive that the password policy is checked and a message is given back with a human readable text?

============================================================================================================
string message = "";
string LDAPPath = getDistinguishedName(LogonName);

try
{
DirectoryEntry deUser = new DirectoryEntry("LDAP://"; + Properties.Settings.Default.DomainFull + "/" + LDAPPath, adUser, adPassword);
deUser.CommitChanges();
deUser.Invoke("SetPassword", Password);
deUser.CommitChanges();
message = "Password updated!";
}
catch (DirectoryServicesCOMException ex)
{
message = "ERROR: + ex.InnerException;
}

if(message.Contains("0x80072035"))
{
message = "INFO: The password doesn't meet the requirements!";
}

return message;
============================================================================================================

I need a way to check:
- has the password the minimum lenght
- is complex enough
- are not used for the last x passwords

???

Thank you for any help
Volkan




.



Relevant Pages

  • Re: Domain Password Policy Question
    ... If you didn't change the password expiration time, only the next change the users will be prompted to new requirements. ... password policy for my domain. ... We currently have the require complex passwords enabled along with the rest ... number of characters we be 15 characters without complexity. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Cant add Users!
    ... Sunny posted a question ... I can add computers, ... Have you checked your password policy for length and complexity? ... If your policy is set to use complex passwords You must have one uppercase ...
    (microsoft.public.windows.server.dns)
  • Re: UNIX Password Security
    ... > I would like to know how I can force end users to develop complex passwords ... > for my AIX system. ... to permit you to tighten up password policy. ...
    (comp.unix.questions)
  • Re: Domain Password Policy
    ... > No password policy in effect. ... > You put a policy in effect that requires complex passwords, ... A domain admin (or delegated user) will need to ... User Must Reset Password At Next Logon.) ...
    (microsoft.public.win2000.security)

Loading