Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7947687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:30:18+00:00 2026-06-04T01:30:18+00:00

If the account does not have user must change at next login checked, I

  • 0

If the account does not have “user must change at next login” checked, I can change the password.
However, if the box is checked, I get a bad password error when I try to access the user.

LogOnUser() returns the correct error code so I know the user must change their password.
As Joe Kaplan says here (back in 2004), I can’t bind to the user to be able to change their passwords.

It’s the same issue whether using AccountManagement/PrincipalContext or DirectoryEntry/DirectorySearcher.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:30:19+00:00Added an answer on June 4, 2026 at 1:30 am

    I did this on a project at my last position. Rather than to try to bind to the user with their own credentials, we set up an AD account with only the rights to make the password change.

    So, once you have the error code indicating that the user must change their password, ask for the new password, grab the user as admin, and make the change.

    As I recall, we had to pass the admin username and password explicitly to make it work, rather than relying on the credentials the code was running under.

    For security, we stored an encrypted copy of the limited admin username and password in the registry, and decrypted it when we were making the call.

    Code will be something like this:

            PrincipalContext dc = new PrincipalContext(ContextType.Domain, 
                "www.yourdomain.com", "dc=yourdomain,dc=com", 
                ContextOptions.SimpleBind, "AdminUserName", "AdminPassword");
            UserPrincipal usr = UserPrincipal.FindByIdentity(dc, 
                "UserWhoNeedsPasswordChanged");
            usr.ChangePassword("oldPass", "newPass");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Customer class which has all the account info.(it does NOT extend
Question How do I create user account by chef-solo? Why does users recipe needs
I have a free trial account in Windows Azure... Does the Compute Hours decrease
I have created login account on my localhost\sql2008 Server (Eg. User123) Mapped to Database
NOTE: Must work on Android 1.5 - ContactsContract does not Simple enough question. I
I've got a form with two fields, firstname and lastname. The user does not
Using Rails 3.1.3. I have Accounts and Users. One Account can have many Users.
On my website I want the user to have the ability to login/logout from
The context: We’re a small company that does not have an Exchange Server (or
Can I have a button in side the form, but do not have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.