11

So I did something really stupid, forgot the admin password to my server running MS Server 2012. I so rarely shut down and have to log in because my server is running 24/7 that when I lost power and had to log back in, I couldn't remember my password. I'm trying to avoid having to reinstall the entire the OS because of a rookie mistake, mostly because of all the services running on this server. I've downloaded quite a few trial "recovery tools" but these seem to do everything except reset a password. If anyone could guarantee that a particular application works and is worth paying for, I'd be happy to pay for something to save myself the days and days of reinstalling and reconfiguring all the different services. So my question is, what is the path of least resistance to getting full access to my server again?

Leon Newswanger
  • 223
  • 1
  • 2
  • 5

3 Answers3

15

This works on Windows Server 2008 R2 and Server 2012 R2. You will need Windows Server 2012 Installation DVD to reset password.

Reset Windows Server Password with Installation CD

  1. Insert the installation disk to your locked computer, restart. When following interface appears. Click “Repair your computer”.
  2. A dialog with several options pops up, choose Troubleshooting tools, then Command Prompt.
  3. At the Command Prompt, type the following 2 commands. (if your correct C: drive doesn't appear, find it first and use that drive)

    copy c:\windows\system32\sethc.exe c:\windows\system32\sethcbak.exe
    
    copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
    
  4. Restart your computer. On the login screen, tap Shift key five times and you'll see a command prompt screen in administrator mode. OK, type net user UserName NewPassword (replace the UserName and UserPassword with the one you need) and press Enter key. The user password will be replaced with new one. Close the window and then you can log in that user with new password.

  5. Once you've logged in successfully, copy the real sethc.exe back in place to prevent a random person from repeating your feat (without at least rebooting the machine):

    copy c:\windows\system32\sethcbak.exe c:\windows\system32\sethc.exe
    
womble
  • 96,255
  • 29
  • 175
  • 230
Volodymyr Molodets
  • 2,424
  • 9
  • 36
  • 52
  • I miss ingenious solutions as this one :) I had a problem however that I couldn't change password in Windows 2012, but I added a new user (via net user), added it to Administrators group, set windows to automatically log in (via control userpasswords2, unchecking "Users must enter..."), and then changing the password for Administrator account through user management. – Nikola Radosavljević May 02 '13 at 20:47
  • 1
    it does indeed work on 2012 machines :) – warren Sep 17 '15 at 19:01
  • I can confirm this approach works on Windows 2012, and on a domain controller as well (don't ask...) In my case, I used the repair mode command prompt to overwrite utilman.exe with cmd.exe, and then pressed Win-U on the login screen to bring up a command prompt, `net user Administrator newPassword`, and then logged in using newPassword. – Dylan Beattie Feb 25 '16 at 14:32
  • 1
    For those (like me) wondering, `sethc.exe` is an accessibility aid. Replacing it with `cmd.exe` lets you use the accessibility keystrokes (5-shift) to get a cmd prompt. – Dan Pritts May 24 '16 at 03:07
  • Yep, worked like a charm. w2012 R2 eng – Jako Oct 02 '16 at 20:12
  • Worked on a _Windows Server 2008 R2_ with a bootable USB drive created from **Windows 7 Download Tool** with an _Windows Server 2012 R2_ iso image. – user1251007 Jan 07 '17 at 13:28
  • I didn't realize that Windows was so insecure. Why would Microsoft allow such a brazen way to circumvent their own username/password process for user accounts – Jon Grah May 16 '22 at 06:52
7

I regularly use Offline NT Password & Registry Editor:

http://pogostick.net/~pnh/ntpasswd/

However, I cannot vouch on whether it works well for Server 2012 or not. As usual, take precautions and perform a backup before attempting this.

gparent
  • 3,601
  • 2
  • 24
  • 28
  • You have to use a password recovery program *regularly*? – EEAA Feb 06 '13 at 04:19
  • 7
    People in the computer repair business constantly get business in doing just that. – Safado Feb 06 '13 at 04:23
  • I'll edit it if my grammar is that bad, but obviously what I meant is that I use that program more often than any others whenever I need to change a password. – gparent Feb 06 '13 at 04:23
0

Use a third party tool to reset the administrator password. There are a variety of these, which you can find with a trivial Internet search.

I won't recommend any particular tool, and neither does Microsoft:

Some third-party companies claim to be able to circumvent passwords that have been applied to files and features that Microsoft programs use. For legal reasons, we cannot recommend or endorse any one of these companies. If you want help to break or to reset a password, you can locate and contact a third-party company for this help. You use such third-party products and services at your own risk.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972