We recommend backing up your data before proceeding.
Resetting the Administrator password on Windows Server OS
During the installation or reinstallation of an Elastic Metal server with a Windows Server operating system, an administrator password is set by you (Administrator account).
If you have lost this password, you can reset it via rescue mode. This guide explains the steps to securely reset the Administrator password and regain access to your server.
Before you startLink to this anchor
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An Elastic Metal server installed
Removing the old Administrator passwordLink to this anchor
- Reboot your Elastic Metal server into rescue mode.
- Log into rescue mode.
- Install the packages
ntfs-3g
andchntpw
using the APT package manager.sudo apt install ntfs-3g chntpw - Mount the Windows system partition.
sudo ntfsfix /dev/sda2
- List the user accounts configured in Windows:
An output similar to the following displays:sudo chntpw -l /mnt/Windows/System32/config/SAMchntpw version 1.00 140201, (c) Petter N HagenHive </mnt/Windows/System32/config/SAM> name (from header): <\SystemRoot\System32\Config\SAM>ROOT KEY at offset: 0x001020 * Subkey indexing type is: 686c <lh>File size 65536 [10000] bytes, containing 7 pages (+ 1 headerpage)Used for data: 343/38728 blocks/bytes, unused: 32/6104 blocks/bytes.| RID -|---------- Username ------------| Admin? |- Lock? --|| 01f4 | Administrator | ADMIN | dis/lock || 01f7 | DefaultAccount | | dis/lock || 01f5 | Invit� | | dis/lock || 01f8 | WDAGUtilityAccount | | dis/lock |Tip
The administrator account of your server can either be
Administrator
orAdministrateur
depending on the installation. - Edit the
Administrator
account by running the following command:A menu displays as follows:sudo chntpw -u Administrator /mnt/Windows/System32/config/SAM================= USER EDIT ====================RID : 0500 [01f4]Username: Administratorfullname:comment : User account with administrative privilegeshomedir :00000220 = Administrators (which has 1 members)Account bits: 0x0010 =[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. |[ ] Temp. duplicate | [X] Normal account | [ ] NMS account |[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act |[ ] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) |[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) |Failed login count: 5, while max tries is: 0Total login count: 2- - - - User Edit Menu:1 - Clear (blank) user password2 - Unlock and enable user account [probably locked now]3 - Promote user (make user an administrator)4 - Add user to a group5 - Remove user from a groupq - Quit editing user, back to user selectSelect: [q] > - Type
1
and press enter to clear the user password:Select: [q] > 1Password cleared! - Type
q
and pressEnter
to quit. A summary of the edited files displays:Hives that have changed:# Name0 </mnt/Windows/System32/config/SAM>Write hive files? (y/n) [n] : - Type
y
and pressEnter
to confirm the writing of the files.Write hive files? (y/n) [n] : y0 </mnt/Windows/System32/config/SAM> - OK - Reboot the server back into normal mode.
Setting a new Administrator passwordLink to this anchor
- Activate remote access on your server to connect via the KVM over IP device.
- Open the remote console to access the screen output.
- Open the start menu and select the
Administrator
username to access user settings. - Click the password panel, then Add to create a new password.
- Enter the new password, confirm it, and set a reminder.
- Exit the remote console. You can now log into your server using the Remote Desktop Viewer and the new password.