The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. (Exception from HRESULT: 0x800708C5)

Posted on 2009-02-13
Last Modified: 2013-12-17
string Username = this.txtLoginId.Text;
            string newpwd = txtNewPassword.Text.ToString();
            string oldpwd = txtOldPassword.Text.ToString();
            string domain = ConfigurationManager.AppSettings["DomainName"];

            PrincipalContext principalContext = null;
                principalContext = new PrincipalContext(ContextType.Domain, domain);
            catch (Exception e)
                MessageBox.Show("Failed to create PrincipalContext. Exception: " + e);

            UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(principalContext, Username);
            if (userPrincipal != null)

                //System.DirectoryServices.AccountManagement.UserPrincipal u = new UserPrincipal(principalContext);
                System.DirectoryServices.AccountManagement.UserPrincipal u = UserPrincipal.FindByIdentity(principalContext, Username);

                //To allow User to Change Password
                u.UserCannotChangePassword = false;

                u.ChangePassword(oldpwd, newpwd);

                u.PasswordNeverExpires = true;
                u.Enabled = true;//By default User is Disabled in Domain



AND I am getting above error on changePassword.

What is the problem?
Question by:rajputamitd

    Author Comment

    If anybody post the comment,I'll reply on it tomorrow.
    LVL 22

    Accepted Solution


    Your system has requirements on how your password  should look like. And the password you input to ChangePassword doesn't meet those requirements.
    Is it a local user or a domain user? If local you could change the policy if you got admin rights. If it's a domain user you'll have to talk to netadmin on what the requirements are.


    Author Closing Comment


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now