Key Takeaways

  • Enable built-in admin account via Windows Recovery Environment
  • Boot into Safe Mode to replace NTUSER.DAT file
  • Use SFC to scan for corrupt files and resolve the error

Most Windows errors occur after you've logged on to your computer. But the "User Profile Service Failed the Logon" error doesn't let you sign in at all, which is why it is trickier to resolve than other Windows errors.

The "User Profile Service Failed the Logon" error occurs due to a corrupt NTUSER.DAT file, a corrupt registry entry or core system file, or an improperly configured User Profile Service. However, you can use the following steps to diagnose and fix the issue effectively.

Enable the Built-In Admin Account Using the Windows Recovery Environment

The first thing you should do is enable the built-in administrator account if you cannot log in using your account. All other fixes would be impossible to execute without this hidden account.

There are multiple ways to enable the built-in administrator account in Windows, but traditional methods won't work here. So, we will use the Windows Recovery Environment (WinRE) to open an instance of the Command Prompt and modify the registry to enable the account.

Before proceeding with the steps mentioned below, manually back up your system registry on a USB drive using the Export option in the Registry editor, if possible.

Follow these steps to enable the administrator account:

  1. Click on the Power icon.
  2. Hold the Shift key and click on the Restart option.
  3. After your PC restarts, click on Continue.
  4. Select Troubleshoot.
    Windows Recovery Environment
  5. Click on Advanced Options > Command Prompt.
  6. Type regedit in the Command Prompt window and press Enter.
  7. Click on the HKEY_LOCAL_MACHINE key in the left pane.
  8. Click on File > Load Hive.
  9. Select This PC option.
    Modify the F binary value in registry to enable administrator account
  10. Click on Windows > System 32 > config folder.
  11. Find the SAM file and double-click on it.
    select the SAM file to load Hive in registry editor
  12. Name the key REM_SAM and click on OK.
  13. Navigate to the following registry key:
            HKEY_LOCAL_MACHINE\REM_SAM\SAM\Domains\Account\Users\000001F4
        
  14. Double-click on the F binary value.
  15. Go to the 00000038 entry in the first row.
  16. Modify the value 11 in the second column of the 00000038 row to 10.
  17. Click on OK.
  18. Exit the registry editor window.
  19. Close the Command Prompt.
  20. Click on Continue to boot to the lock screen. You will see an additional administrator account on the lock screen.

Boot Into Safe Mode

After enabling the built-in administrator account, the first thing you should do is boot Windows into Safe Mode. Safe mode essentially boots Windows with the bare minimum features and programs that it needs to function.

To boot into Safe Mode, follow these steps:

  1. Power up your computer as you normally would.
  2. When you reach the Sign In screen, hold down Shift and go to Power > Restart.
  3. Select Troubleshoot.
    Windows Recovery Environment
  4. Click on Advanced Options > Startup Settings > Restart.
  5. After your computer reboots, click on Safe Mode with Networking.
  6. Your computer will restart in Safe Mode.
  7. Log in to the administrator account and then proceed with the methods mentioned below.

Replace the NTUSER.DAT File

NTUSER.DAT file stores data about the user account, and if it is corrupt, you must replace this file. Log in to the administrator account that you enabled previously. Then repeat the following steps:

  1. Press Win + E to open the File Explorer.
  2. Click on View > Show > Hidden items.
    view hidden items in file explorer
  3. Open the Default folder. Click on the NTUSER.DAT file and rename it to 'NTUSER.DAT.OLD'.
  4. Press Backspace. Go to the Administrator folder and copy the NTUSER.DAT File.
  5. Revisit the Default folder and paste the copied file there.
    copy ntuser file to default folder
  6. Restart your PC to apply the changes.

Use SFC to Scan for Corrupt Files

The most likely cause for the "User Profile Service Failed the Logon" error is a corrupt user file. This can happen due to various reasons, ranging from antivirus software scanning upon boot to a power cut while powering on your computer.

Fortunately, Windows has some in-built utilities that can help you find and fix corrupt Windows files automatically. One such utility is called System File Checker (SFC), and it is executed using Command Prompt:

Command Prompt window with the sfc command
  1. Ensure that your computer is in Safe Mode.
  2. In the Start menu search bar, type cmd and select Command Prompt.
  3. In the Command Prompt window, type sfc /scannow and press Enter.
  4. Windows will begin scanning your computer for any corrupt files and automatically fix them. The whole process should take about 30 minutes.
  5. After the scan is complete, reboot your computer and try logging in again.

Restore Your Computer to an Earlier State

Windows has a useful feature called System Restore that lets you roll back changes to your computer and restore it to an earlier point in time.

Before proceeding further, you should know that the feature is not enabled by default, and you have to manually create restore points unless you configure Windows to create daily restore points.

If you remember creating a restore point before the error popped up, follow these steps:

System Restore wizard Windows 10
  1. Press Windows key + R to launch the Run dialog.
  2. In the Run box, type rstrui.exe and hit Enter.
  3. On the System Restore dialog box, click on Next.
  4. Choose a restore point from the list.
  5. On the next window, double-check everything and click Finish.
  6. Windows will restore itself to an earlier state, and you should now be able to log in without any hassles.

You should back up any important data or applications that they may have installed after creating the restore point.

Change Registry Configuration

Another way to tackle the "User Profile Service Failed the Logon" error is to make some changes to the Registry. This is an advanced troubleshooting method, and it is recommended that you create a System Restore point before proceeding further.

Do the following to configure the Registry properly:

Windows 10 Registry Editor
  1. Boot into Safe Mode using the steps in the first section of this article.
  2. Press Windows key + R to open the Run prompt. Type regedit and press Enter.
  3. In the Registry Editor, using the navigation bar on the left, go to:
            HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\Profile List
        
  4. Here, you should see two files with the same name, but one will have .bak as an extension.
  5. Right-click on the file with the .bak extension and select Rename. Remove the .bak extension while leaving the filename untouched, and press Enter.
  6. Now, right-click on the file that didn't originally have the .bak extension and add .bak at the end of it.
  7. In the folder that has the renamed file from step 5, right-click on State, then select Modify.
  8. Change the value in Value data from 8000 to 0 (zero).
  9. After this, right-click on the RefCount entry and change the value in Value data to 0 (zero).
  10. Confirm the changes and close the Registry Editor.
  11. Reboot your computer and log in.

What if You Don't Find a .bak File in the Registry Editor?

It is unlikely, but your computer may not have created a file with the .bak extension. In this case, open Windows Explorer and go to:

        C:\Users\Default\AppData\Local\Application Data

If you find another folder named Application Data under the one you're on, delete it, and reboot your computer. It should fix the problem.

Enable the User Profile Service

In certain instances, the User Profile service itself may be disabled. Usually, a third-party application is the culprit. Luckily, you can enable it by running a simple command in the Command Prompt window:

Command Prompt in Windows 10
  1. Boot your computer into Safe Mode.
  2. In the Start menu search bar, type cmd. From the search results, right-click on Command Prompt > Run as administrator.
  3. In the Command Prompt window, type sc config ProfSvc start= auto and press Enter.
  4. After this, type sc start ProfSvc, and press Enter.
  5. Close Command Prompt and reboot your computer.

Some of these methods are useful in diagnosing many other common Windows errors as well. So, it's useful if you keep them in mind when you experience other issues on your computer.