How to Delete User Profiles in Windows 11 and Windows 10

How to Delete User Profiles in Windows 11 and Windows 10 blog banner image

This guide explains how to delete user profiles in Windows. It covers removing user profiles in both Windows 10 and Windows 11, and includes multiple methods, as well as precautions and troubleshooting tips. The methods covered include manual deletion, using PowerShell, and deleting user profiles using group policy.

What is a user profile in Windows?

A user profile in Windows is the folder that contains all of the files and settings unique to a user, either on a single computer or on a server where it can be loaded from multiple machines. User profiles contain files such as your documents, downloads, music, and pictures folders that are visible in your home directory, as well as application data and settings (that are usually hidden unless you manually access them). Corresponding entries in the Windows Registry also exist for storing additional configurations.

There are several types of user profiles in Windows operating systems:

  • Local: Local profiles are stored on the computer they are used on and are not shared across computers.
  • Roaming: Roaming user profiles are stored on a server (usually a Domain Controller) and can be loaded from any machine connected to the same network, or over a VPN.
  • Mandatory: A mandatory user profile is a type of roaming profile that has been pre-configured by an administrator and cannot be changed by the user. For example, it may have its desktop background and icons preset for a specific task.
  • Temporary: Temporary user profiles in Windows are created when a user’s regular profile cannot be accessed or has been corrupted in some way. The data created while you’re logged into a temporary profile is not retained once you log out.

If you’re a home user, you’re most likely working with local user profiles. If your computer is part of a corporate network or Windows Domain, you may be using a roaming profile that lets you use the same desktop environment and files across multiple machines.

Precautions before deleting Windows user profiles

As a user profile holds all of the data a user has created, including their internet favorites, chat histories, emails, and other hidden application data, you must be sure that you want to delete it, and have the authority to do so. If you’re fixing up a friend or family member’s computer, they might not be happy to lose these types of hidden data and settings in their profile, even if you’ve made a copy of the files that were visible.

Before you try to delete user profiles in Windows 10 or Windows 11 you should take the following steps:

  • Inform the user of what you will be doing, and ensure that they have a copy of their important data.
  • Take your own, complete backup of the user profile before you delete it. Taking a system restore point is one way of doing this.
  • It may also be wise to take a full system backup in case a mistake is made and the wrong profile, or other data, is accidentally deleted.
  • Make sure the user is logged out and that no programs are running under their user account.

In a corporate environment, the repercussions of deleting valuable business data may be more severe. If you are deleting a roaming profile on a user’s device to resolve an issue, make sure that all data has been uploaded back to the server.

How to delete user profiles in Windows 11

Windows 11 user profile management can be done using the Windows System Properties interface, using the command line, and via PowerShell.

Using Windows System Properties

  • Right-click on the Start button and click System.
  • Click on Advanced System Settings.
  • Click on Settings under the User Profiles section.
  • Select a user profile from the list and then click Delete.

Manually

If for some reason Windows is unable to completely remove all traces of a profile, you can manually delete it:

  • Open the File Explorer and navigate to C:\Users
  • Delete the folder for the user profile.
  • Right-click on the Start button, click Run, and enter “regedit” to open the Registry Editor.
  • In the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  • Delete the registry entry for the profile. You can identify which entry matches the profile you wish to remove by looking at the ProfileImagePath, which will point to a file in the folder that you deleted.

Using command line

You can delete users from the Windows command line by running the command, replacing USERNAME with the username of the profile to be deleted:

net user USERNAME /delete

You will then need to delete the user directory by running:

rd /s /q “C:\Users\USERNAME”

Confirm all commands and directory paths before running them, as the /q option turns off all confirmation prompts, and once files are deleted via this method, they are not recoverable from the Recycle Bin.

Using Delprof2

Delprof2 is a third-party tool for deleting user profiles in Windows. It can be used for automated Windows profile removal, and can be used remotely.

By default, Delprof2 deletes all inactive user profiles (so, if your user account is the only one logged in to a machine, every other account will be completely deleted), and it is able to delete profiles even when file permissions are preventing deletion via other methods. You can set filters to delete cached roaming profiles, or profiles that haven’t been used for a period of time, making it a powerful troubleshooting and administration tool.

The below example command deletes accounts older than 100 days using the /d parameter, excluding the administratordefault, and Public profiles using the /ed parameter:

DelProf2 /ed:administrator /ed:default /ed:Public /d:100

Using PowerShell

The below single-line PowerShell command will delete a user profile for a user with the given USERNAME:

Get-WmiObject -Class Win32_UserProfile | Where-Object { $_.LocalPath -like “*USERNAME*” } | Remove-WmiObject

This command must be run as Administrator. The command consists of the following PowerShell Cmdlets:

  • Get-WmiObject -Class Win32_UserProfile Lists all user profiles .
  • Where-Object { $_.LocalPath -like “[USERNAME]” } Filters the results of the above command and finds the user profile that matches USERNAME.
  • Remove-WmiObject deletes the matching profile.

You should then delete the user profile directory from C:\Users manually.

Using Group Policy to manage user profiles

On networks that use roaming profiles and have a high turnover of users, it may be beneficial to automatically delete unused profiles. This can be done using Group Policy in Active Directory.

This can be done by creating or editing a Group Policy in the Organizational Unit where you want to automate profile deletion, and enabling and configuring the policy named Delete user profiles older than a specified number of days on system restart which is located at Computer Configuration/Administrative Templates/System/User Profiles.

Some users report, however, that this method is not effective as some services may update files in user profile folders, constantly resetting the timeout for deletion.

How to delete user profiles in Windows 10

If you are performing Windows profile cleanup for older Windows 10 devices, the process for each method above is the same as deleting user profiles in Windows 11.

Additional best practices and troubleshooting tips

In addition to the precautions above, there are several best practices you can follow when cleaning up Windows user profiles:

  • If you cannot delete a profile as it is in use, ensure that the user is logged off, and reboot the computer before trying to remove the profile again. You can also boot into safe mode to prevent other services launching from that user account so that it can be deleted.
  • If you cannot delete a profile due to permissions issues, make sure you’re logged in as an Administrator, or try using Delprof2.
  • When deleting a roaming profile so that it can be re-loaded from the server make sure to confirm that the user can properly log in, that their profile is properly re-created, and that they do not receive a temporary profile, as that may lead to data loss when they log out.

If you are managing profiles on a network, consider providing network shares for users to store their files and enact policies that discourage saving files locally. This will prevent Windows user profile issues from compromising important data.

Safely managing Windows user profiles on enterprise networks

Managing Windows user accounts at scale is a key challenge for IT teams. Users must be confident that their user profiles are properly configured, avoiding issues with temporary profiles and data loss.

An endpoint management solution such as NinjaOne ensures that devices are up-to-date and that network policies are enforced. Additionally, devices can be configured, managed, and backed up remotely, ensuring that if a user profile is corrupted or lost, valuable data can be recovered.

Next Steps

Building an efficient and effective IT team requires a centralized solution that acts as your core service deliver tool. NinjaOne enables IT teams to monitor, manage, secure, and support all their devices, wherever they are, without the need for complex on-premises infrastructure.

Learn more about Ninja Endpoint Management, check out a live tour, or start your free trial of the NinjaOne platform.

You might also like

Ready to become an IT Ninja?

Learn how NinjaOne can help you simplify IT operations.

Watch Demo×
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

Start your 14-day trial

No credit card required, full access to all features

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).