NavigationContentFooter
Jump toSuggest an edit

Resetting the Administrator password on servers running Windows Server

Reviewed on 24 June 2024Published on 14 December 2023

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.

Before you start

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 password

  1. Reboot your Elastic Metal server into rescue mode.
  2. Log into rescue mode.
  3. Install the packages ntfs-3g and chntpw using the APT package manager.
    sudo apt install ntfs-3g chntpw
  4. Mount the Windows system partition.
    sudo ntfsfix /dev/sda2
  5. List the user accounts configured in Windows:
    sudo chntpw -l /mnt/Windows/System32/config/SAM
    An output similar to the following displays:
    chntpw version 1.00 140201, (c) Petter N Hagen
    Hive </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 or Administrateur depending on the installation.

  6. Edit the Administrator account by running the following command:
    sudo chntpw -u Administrator /mnt/Windows/System32/config/SAM
    A menu displays as follows:
    ================= USER EDIT ====================
    RID : 0500 [01f4]
    Username: Administrator
    fullname:
    comment : User account with administrative privileges
    homedir :
    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: 0
    Total login count: 2
    - - - - User Edit Menu:
    1 - Clear (blank) user password
    2 - Unlock and enable user account [probably locked now]
    3 - Promote user (make user an administrator)
    4 - Add user to a group
    5 - Remove user from a group
    q - Quit editing user, back to user select
    Select: [q] >
  7. Type 1 and press enter to clear the user password:
    Select: [q] > 1
    Password cleared!
  8. Type q and press Enter to quit. A summary of the edited files displays:
    Hives that have changed:
    # Name
    0 </mnt/Windows/System32/config/SAM>
    Write hive files? (y/n) [n] :
  9. Type y and press Enter to confirm the writing of the files.
    Write hive files? (y/n) [n] : y
    0 </mnt/Windows/System32/config/SAM> - OK
  10. Reboot the server back into normal mode.

Setting a new Administrator password

  1. Activate remote access on your server to be able to connect to it using the KVM over IP device.
  2. Open the remote console to visualize the screen output of your machine.
  3. Open the start menu and click the Administrator username to open the user settings.
  4. Click the password panel, then Add to configure a new password.
  5. Enter a password, its confirmation and a reminder, then validate.
  6. Exit the remote console. You can now log into your machine using the Remote Desktop Viewer and your newly set password.
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway