CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2016
    Posts
    3

    What is the right api to reset user password in safe mode?

    I am looking for a winapi to reset local password for windows xp/vista/7/8/10. I searched on google and can't find such a library. Some of them only work for vista and below; some of them only for windows 7 and higher. Please help.

  2. #2
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,551

    Re: What is the right api to reset user password in safe mode?

    Windows provides this functionality already for administrators, so why do you need an api to do this as part of a program?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  3. #3
    Join Date
    Oct 2016
    Posts
    3

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by 2kaud View Post
    Windows provides this functionality already for administrators, so why do you need an api to do this as part of a program?
    This is mainly applied to cases when user forgot the login password. They can't access the computer as normal

  4. #4
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,551

    Re: What is the right api to reset user password in safe mode?

    but in that case the administrator can reset the user's password using existing tools. But be aware, if the administrator force resets a user password this can have implications for that user's access to certain data etc.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,607

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by Yinnyccp View Post
    This is mainly applied to cases when user forgot the login password. They can't access the computer as normal
    Forcing a User to Change the Logon Password by claiming current one expired. The password is going to be reset by Windows, but not your code.
    Best regards,
    Igor

  6. #6
    Join Date
    Oct 2016
    Posts
    3

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by Igor Vartanov View Post
    Forcing a User to Change the Logon Password by claiming current one expired. The password is going to be reset by Windows, but not your code.
    thanks, but it is not my case. The user can't do anything as it forgot the login password.
    Last edited by Yinnyccp; October 20th, 2016 at 09:09 PM.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,494

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by Yinnyccp View Post
    thanks, but it is not my case. The user can't do anything as it forgot the login password
    This is the point of Windows security - if you 'forgot' or don't know the password, you can't get get in.

    Allowing a programmer to bypass the password in code would be a security hole.

  8. #8
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,551

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by Yinnyccp View Post
    thanks, but it is not my case. The user can't do anything as it forgot the login password
    In which case the administrator needs to reset the password using existing tools as already explained. As Arjay points out, if the user doesn't know the correct password they can't get in. This is by design for security. This is why there is always at least one administrator account on Windows systems that can be used to reset the password for a user. But the password for the administrator account(s) still need to be known. If the password for an administrator account is also not known then that is a different matter.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  9. #9
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,607

    Re: What is the right api to reset user password in safe mode?

    Quote Originally Posted by Yinnyccp View Post
    thanks, but it is not my case. The user can't do anything as it forgot the login password
    Please make a detailed description of your case, what goes after what.

    As far as I understand you, some user forgets his pass. You somehow appear to be able to invoke your app running admin privileges and want the app to reset the pass. Please explain in terms of security, how this is better than logging in with admin account and using management console? Do you clearly understand that your app is a breach in Windows security?
    Best regards,
    Igor

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured