How to Reset a Local Administrator Password on Windows | Windows OS Hub (2024)

Windows OS Hub / Windows 10 / How to Reset a Local Administrator Password on Windows

July 5, 2023 Questions and AnswersWindows 10Windows 11Windows Server 2019

It can happen that you have forgotten your Windows login password and can no longer log on to your computer. This article shows you how to reset a forgotten password for the local administrator account using a Windows installation media (USB flash, DVD, or ISO image). This password reset guide covers both Windows 10/11 and Windows Server 2022/2019/2016.

You will need any Windows 10 or 11 installation media to reset the local administrator password. The easiest way is to create a bootable Windows USB flash drive using the Media Creation Tool or use the Rufus tool to write the downloaded Windows ISO image to a USB flash drive

  1. When you start the computer, enter the BIOS/UEFI settings, and select your USB flash drive as the primary boot device. To do this, press F1 , F2 or Del (depending on your hardware vendor), find the Boot Order/Boot Device Priority item (menu item names depend on the manufacturer and BIOS/UEFI firmware version), then set your Removable USB flash drive as the primary boot device;How to Reset a Local Administrator Password on Windows | Windows OS Hub (1)
  2. When the computer starts, the message ‘Press any key to boot from CD/DVD/USB‘ should appear;
  3. The next thing you will see is the Windows Setup wizard. Use the key combination Shift+F10 to open the command prompt;
  4. The next thing you need to do is to find out the drive letter assigned to the partition where Windows is installed. Run the command:
    wmic logicaldisk get volumename,name
  5. You can see that in my example, Windows is on the C: drive. This is the letter we will use in the following commands;
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (2)

    If your system partition is encrypted with Bitlocker and you have the password to decrypt it, you must first unlock the BitLocker-encrypted drive with the command: manage-bde -unlock C: -pw. Once you’ve done this, you can reset the administrator password.

    You can also identify partitions and their assigned drive letters in the WinPE environment using the diskpart command. For that, run the following commands one after the other: diskpart -> list disk (to display a list of hard disks available) -> list vol (list partitions and their assigned drive letters). In this example, there is only one Disk 0 with a GPT partition table and three partitions: the EFI system partition (with the FAT32 file system, which contains the Windows EFI bootloader), the recovery partition (with the WinRE recovery environment), and the primary partition with the NTFS file system and size of 39GB (with the C drive letter assigned);
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (3)
  6. Run the following command to back up the original utilman.exe file:
    copy C:\windows\system32\utilman.exe C:\windows\system32\utilman.exebak
  7. Then replace the utilman.exe file with the cmd.exe file:
    copy c:\windows\system32\cmd.exe c:\windows\system32\utilman.exe /y
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (4)
  8. Eject the bootable flash drive/Windows Setup ISO and restart the computer:
    wpeutil reboot
  9. Boot normally to Windows which is installed on your computer. On the sign-in screen, click on the Easy of Access (Accessibility) icon;
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (5)
  10. A command prompt should appear. Make sure that the console is running under NT Authority\SYSTEM: whoami
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (6)
  11. You can manage local Windows accounts from this command line.
    List the user accounts with administrator rights on the computer:
    net localgroup administrators
    There are two users in the Administrators group in this example. You can reset the password for any of these users to log on to Windows.
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (7)
    If the group is empty, this means that you need to assign administrator rights to one of the available local Windows users. List all local users:
    net user
    In order to add user1 to the local Administrators group, run the following command:
    net localgroup administrators user1 /add
    If you have no other users on the computer except the built-in Administrator account, you will need to reset the password for this account.

    If you use a Microsoft account on your computer, you can reset its password via https://account.live.com/password/reset. If you can’t recover your password in this way, you must enable your local Administrator account, reset its passwords, and sign in with it. You should then create a different local user with administrative privileges, or add a new user with a cloud-based Microsoft account.

  12. To reset the user’s password (in this example, the username is root), run the command:
    net user root *
    Set a new password and confirm it (the new password must match your local Group Policy password settings);
    How to Reset a Local Administrator Password on Windows | Windows OS Hub (8)
  13. Now you need to check if your account is enabled. Display the account information: net user root
    If the user is disabled (Account active: No ), enable it:
    net user root /active:yesHow to Reset a Local Administrator Password on Windows | Windows OS Hub (9)
  14. Restart your computer and boot it again from the removable USB flash drive/ISO image. Replace the utilman.exe with the original file to avoid leaving a security hole in Windows:
    copy c:\windows\system32\utilman.exebak c:\windows\system32\utilman.exe /y
    After that, remove the flash drive and once again reboot the computer;
  15. Now you can log on to Windows using the account that you reset the password for.

    In case you get an error ‘The Sign-in method you’re trying to use isn’t allowed’ when trying to sign in to Windows, it means that you have the corresponding group policy enabled on your computer. You can disable this policy option using the local GPO editor (gpedit.msc). You can also run this MMC snap-in from the command prompt on the Windows logon screen.

The example above shows how to reset the password by replacing the utilman.exe file. Note that the same trick can also be used by replacing the sethc.exe executable. If you have replaced sethc.exe with cmd.exe, just press the Shift key 5 times to open the command prompt on the Windows welcome screen (this triggers Sticky Keys mode and causes the sethc.exe executable to run).

After resetting a user’s password, you will still have access to all files in the user’s profile, programs and settings, saved passwords in Windows Credential Manager, and all other data available for the user (note that you may lose access to EFS-encrypted files).

Note that if your computer is added to an Active Directory domain, it may be affected by various settings through domain Group Policies (GPOs). To help keep computers secure, Domain Administrators can assign specific policy settings to computers. For example, disable all local user accounts, remove local users from the Administrators group, or automatically change the password of the built-in admin account (via Windows LAPS). In that case, if you need to reset the administrator password on such a computer, you must first reset the local policies and clear the GPO cache, and then disconnect the computer from the network. You can then log in to Windows as a local administrator with the new password.

In the same way, you can reset the password of the Active Directory domain administrator.

previous post

Check for Open (Listening) Ports with PowerShell

next post

How to Backup and Copy Local Group Policy Settings to Another Computer

Related Reading

Configure File and Folder Access Auditing on Windows...

June 27, 2024

Install Any OS from ISO Image over Network...

June 24, 2024

How to Add or Remove Pinned Folders to...

June 18, 2024

How to Assign (Passthrough) a Physical GPU to...

June 11, 2024

Printing from Linux to a Windows Shared Printer

May 29, 2024

Leave a Comment

How to Reset a Local Administrator Password on Windows | Windows OS Hub (2024)

References

Top Articles
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 6194

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.