If you’re looking to do some general house cleaning, a great first step is knowing how to delete user profiles in Windows 10. Removing user profiles in Windows is a great general practice and it helps keep the space to a minimum on the local disk. It’s also great for security too! Today we’re going to cover SEVERAL steps on how to complete this action on a single machine or many machines in bulk.
Table Of Contents
Delete User Profiles In Windows 10
First off, there are several methods to accomplish this task and we’ll cover the most common ways of doing this. To give you an overview, we’ll review the manual method, the scripted method using delprof2 and the bulk method using Group Policy. Each method has its own pros and cons and you’ll be able to choose which one works best for you.
Method 1 – Delete User Profiles Manually
If you want to delete a user profile in Windows and don’t want to download any additional tools, this will perhaps be the best option for you. We already know that this won’t scale and should only be used for adhoc situations.
On your Windows machine:
- Navigate to start -> run -> type sysdm.cpl to access the advanced system properties
- Select the user profile you want to delete
- Click delete
There are occasions when you might have to manually delete the folder under C:\Users as well so that’s something that you should be aware of.
Method 2 – Remove User Profiles using DelProf2
If you’re looking for more of a scripted approach, delfprof2 definitely takes the cake on that one. DelfProf2 is the evolution to Microsoft’s original DelfProf (Delete Profile) but that was sadly no longer being updated after Windows XP. Since DelProf2 doesn’t come standard on Windows machines, it is something you will have to download from the owners website. It’s completely free but just note that it’s not an official Microsoft product.
Direct Download Link: https://helgeklein.com/downloads/DelProf2/current/Delprof2 1.6.0.zip
This allows you to use the command line interface to touch multiple machines without much effort. This mighty program also supports the removal of user profiles after x amount of days so that’s great if you don’t want to leave those stale profiles on the machines. Let’s cover a common example to help you get started (assuming you’ve already downloaded the app from the link above).
List accounts that haven’t logged in for 14 days
PS C:\delprof> .\DelProf2.exe /l /d:14
List accounts that match the name ‘Luke’
PS C:\delprof> .\DelProf2.exe /id:luke /l
For a full list of options you can always run /?
to see what switches are currently suppported.
Method 3 – Removal using Group Policy
Our last option allows us to remove user profiles using Group Policy. This options is by far the one that scales the best since Group Policy is used in many on-premises infrastructures. Let’s look at the settings to enable this policy via GPO.
With Group Policy Editor open:
- Navigate to Computer Configuration → Administrative Templates → System → User Profiles
- Select Delete user profiles older than a specified number of days on system restart
- Click Enabled and set the number of days to trigger the policy
While this option is great and scalable, some users have noticed that the username folder under C:\Users is still there. If that’s the case, you may need clean that manually if it poses an issue.
Conclusion
Hopefully, this article was able to show you how to delete user profiles in Windows 10. I provided 3 options that are pretty scalable as well a quick adhoc method.
Again, just to reiterate, you should always test before applying any configs just to ensure that everything is working as expected. If you like this article, be sure to check out our own PowerShell Gallery for awesome scripts.
Getting this error when running
Get-Process : A positional parameter cannot be found that accepts argument ‘.\DelProf2.exe’.
any ideas?