Advanced Setup Guides

Reset Administrator Password on Windows Server

15min

A Step-by-Step Guide for Windows Server 2012-2019

This guide describes a common method to regain access to a Windows Server OS (used in scenarios when the password for an administrator account is forgotten or lost), without reinstalling the whole operating system or losing any data.

Access the VPS Management Portal

Mount System Rescue CD and Boot

  • Click Mount ISO
  • Select System-Rescue-CD-6-x86.iso image
  • Set button "force reset & boot"
  • Finish mount by clicking "Mount ISO"
Document image




Launch noVNC

  1. Click "Launch noVNC" to see console output
  2. Click into the noVNC browser window to set focus
  3. Select "Boot SystemRescueCd using default options"
  4. Press Enter to confirm
Document image


Identify and mount your Windows Partition

Use the SysRescueCD Recovery image to access your Windows system. To identify the correct device for password reset, enter this command:

shell


The output will look similar to the below:

Document image


If you see two devices, the first one is usually a bootable device (Boot *) while the second one serves as the partition where Windows is installed. The latter one we are after. In general, we are looking for the larger partition. In our example, partition /dev/vda2 is where Windows is installed (74.5GB vs 500MB) Now navigate to the existing 'mnt' directory, create a 'Windows' director in it, and mount the 'vda2' partition over the newly created "Windows" directory:

Shell


After running the mount command, you might encounter error messages like this: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Falling back to read-only mount because the NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting.) Don't worry, just execute command step-by-step: umount /mnt/Windows ntfsfix /dev/vda1 ntfsfix /dev/vda2 If successful, you will receive the following output:

Document image


Now mount your Windows partition again: mount -t ntfs -o rw /dev/vda2 /mnt/Windows



Reset the Administrator Password

Navigate to the directory where SAM (Security Account Manager) file is located:

Shell

Document image


Create a backup of the SAM file:

Shell


Display the usernames stored in the SAM file without making any changes:

Shell


Example output:

Document image


Target the "Administrator" account in the SAM database The command will then present you with options to modify the account, such as clearing the password, editing the password, promoting the user to an administrator, and other related tasks.

Shell


We are interested in the first item from the list "Clear (blank) user password". This option allows the Administrator user to login without indicating a password and to set a fresh password at the console. Select -> 1 and press Enter:

Document image


Confirm to the modifications by typing "y", then press Enter:

Document image


Your tasks with SysrescueCD are now finished. You need to restart your system.

Unmount the ISO

Once the password is reset, make sure to unmount the ISO (Sysrescue CD) image. This can be done in the KVM management portal.

Reboot and Test

After rebooting, Windows will automatically log in to the Administrator account without requesting a password. Open the CMD(Command Prompt) with administrative rights:

Document image


Set a new password for the Administrator account with the following command:

Shell

Document image


Disable VNC access

Now close the noVNC tab, turn off VNC access in the KVM management portal, and then connect to the server using Windows Remote Desktop with your new password.

🎉 Congratulations!

You've successfully updated your Windows Administrator password. Now, try logging into the server with your new credentials. This is crucial to ensure that the password change took effect and that you have regained access to your server. Happy computing! :)