Old user profiles are making life difficult for you. They eat up space, slow down troubleshooting times, and can re-introduce forgotten problems. There are a few ways to handle old profiles. Some will use simply delete them (bad mistake). Others will manually run the tool DelProf. But you, wise reader, prefer the automatic way. That is why you perform user profile cleanup with Group Policy!
How to Delete Old Profiles with Group Policy
Create a new GPO named User Profile Cleanup and edit it. Browse to Computer Configuration\Policies\Administrative Templates\System\User Profiles. Enable Delete User Profiles Older than a Specified Number of Days on System Restart.
The default deletion age for a profile starts at 30 days. You will need to think about your environment and how your computers are used. Do you stored all critical information and documents outside of the user profile (ex: by using folder redirection)? Then you can probably set the deletion value to a lower number such as 14 days.
If you do keep important information in your local profiles, consider how old a profile needs to be before it should be considered obsolete. 90 days might be a more appropriate number for you. If your organization has down time, keep that in mind (ex: School Systems that are off in the Summer).
With your setting enabled, link your GPO. Remote into a few machines and take a snapshot of the Users folder. Check back after the user profile service runs. You should be pleasantly surprised by how clean everything is!
Remember that the user profile service will only clean profiles on a reboot. If your machines never restart, this setting won’t help you. Our next post will cover automatic restarts and why you need them. If you have any questions about this Group Policy setting or on cleaning up machines, leave a comment below.
This policy will remove the folder and will also remove the profile under the listing under system>advanced>profiles. The problem is that it leaves the registry entry for that user HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and as long as that entry remains, if a user attempts to login it will give them a temporary profile only. Has no one seen this issue?
I have not see that issue… let me know if you find out what is causing that issue for you though.
Does this work on Server 2012r2 TS
It does. I use it every day!
How about Windows 10? Has anyone tested this?
I’m trying to get this to work on windows 10, and it seems like this process checks the ntuser.dat file… Our antivirus seems to be modifying that file causing it to never delete profiles.
Anyone else get around this?
I have read you can also check ntuser.ini instead .. but that won’t help for this policy. Another option could be this tool: https://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/
Delprof2 is a good tool! Thanks for the comment.
Any luck with getting this to run on Windows 10? I have the policy deployed and it’s being applied, just not deleting the profiles like you’d expect it to.
Well that’s a nice trick!
Thanks Richard! Let me know if you run into any issues when setting this up.
That’s pretty slick…I can think of how this might be useful for some shared computers that are used for presentations in a conference room, etc.
Group Policy can do some pretty awesome things! This is one of a handful of settings that I can see being needed everywhere.
Like your article re clearing old profiles,
Q?…will it remove the administrator and public profiles?
What if you want to keep a certain profile?
thanks …GP can make you look awsome :):):)
Thanks John! It will remove the administrator profile but not the default or public profiles.
You would need to modify something in that profile. You could deploy a scheduled task with Group Policy Preferences that modifies the profile. And you are right – GP can make you look awesome!!
This is an old thread just wondering if anyone knows for sure that this will not delete the public or default profile regardless of age?
These profiles are excluded and will not be deleted.