Re: AD Change Password issue

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 01/31/05

  • Next message: Joubert: "Client/server application and Windows Integrated Auth"
    Date: Mon, 31 Jan 2005 16:00:26 -0600
    
    

    You need to make sure that the password you are changing to hasn't been used
    recently and meets the policy requirements (try adding numbers too or
    something).

    Otherwise that should basically work. You might want to set
    userAccountControl in a separate step too.

    Joe K.

    "Sathya Gomathi via DotNetMonster.com" <forum@DotNetMonster.com> wrote in
    message news:e5f377760c5a4269889e40a3a4b20ccd@DotNetMonster.com...
    > Hi,
    >
    > I trying to change password of an account in AD. This the code iam using
    >
    > string adspath = "LDAP://SYST.ctc.edu/CN="+username+",OU=Users,OU=Seattle
    > District (060 - SCCD),OU=Washington Colleges,DC=SYST,DC=ctc,DC=edu";
    > DirectoryEntry entry1 = new DirectoryEntry (adspath, @"domain\username",
    > "PWD", AuthenticationTypes.Secure);
    >
    > string OldPassword = "OLDPWD";
    > string NewPassword = "mynewsecre@t!#*";
    >
    > object[] tt = new object[]{OldPassword, NewPassword};
    >
    > try
    > {
    > entry1.Invoke( "ChangePassword" ,tt );
    > entry1.Properties["userAccountControl"].Value = 0x0200;
    > entry1.CommitChanges();
    > }
    > catch(Exception excp)
    > {
    > throw(excp);
    > }
    >
    > I get this exception
    > "System.Runtime.InteropServices.COMException (0x800708C5): The password
    > does not meet the password policy requirements. Check the minimum password
    > length, password complexity and password history requirements."
    > }
    >
    > --
    > Message posted via http://www.dotnetmonster.com


  • Next message: Joubert: "Client/server application and Windows Integrated Auth"