When you purchase a VPS with Windows Server 2022, you choose a password for the 'Administrator' account during the initial Windows configuration. It is important to keep this password safe (we have no access to it). If you lose your Administrator password, you can reset it via Linux Rescue mode in the control panel.
Before you begin, create a snapshot of your VPS. In our internal tests, it was occasionally necessary to restore a snapshot and repeat the procedure for the password to be reset without unexpected side effects, such as losing the linked Windows Server license.
Step 1
In the console in the control panel, click on 'Options' and then start 'Boot Linux rescue mode'.
Step 2
The previous step does not shut down the VPS 'cleanly'. This is always the case when Windows is not shut down from within Windows itself via start > power > shut down. In that case, step 3 will show the error message 'The disk contains an unclean file system'. You can fix/prevent this with the command:
ntfsfix /dev/vda2
Step 3
Create the mount directory and mount the VPS disk in it with the commands:
mkdir /mnt/windows
ntfs-3g /dev/vda2 /mnt/windows -o force
Step 4
Now switch to the System32 folder:
cd /mnt/windows/Windows/System32/config
Step 5
Check the available accounts with the command:
chntpw -l SAM
You will now see an overview of the available accounts:
Step 6
Specify the desired user, usually the 'Administrator' user.
chntpw -u Administrator SAM
The available options will be displayed at the bottom of the output:
Step 7
Press 1 to remove the current password, and then press 'q' and 'y' to exit the user editor and save the changes.
Step 8
Unmount your disk with the command:
umount -l /mnt/windows
Step 9
Now restart your VPS via the 'Restart' or 'Reset' button in the control panel. It takes a few seconds for the process to start. Do not use the 'reboot' command or the 'ctrl-alt-del' button to restart. This will cause a network boot and show the OS installation screen instead of the login screen.
The whole process of restarting, logging in automatically, and Windows being ready for use can take a few minutes.
Step 10
Click the Windows Start button and select 'Settings'.
Step 11
Then click on 'Accounts'.
Step 12
Select the options 'Sign-in options' > 'Password' > 'Add'.
Enter a new password and a password hint, and click 'Next' to save the new password.
Step 13
It is advisable to test the new password immediately. Click on the Windows Start button and then on 'Administrator' > 'Sign out'. Log in again.
This concludes this guide on resetting your Administrator password in Windows Server 2022.
Should you have any questions based on this article, please do not hesitate to contact our support department. You can reach us via the 'Contact us' button at the bottom of this page.