Problem after deleting old user profiles (Win7 desktop)

Reply to topic
11 posts
I was testing the "Delete user profiles older than a specified number of days on system restart" local policy on two Windows 7 Enterprise (32-bit) computers that are used a lot by students, so I wanted old profiles to get deleted & not cruft up the local system over time (these are local profiles not roaming profiles).

The problem I've found now that the first profiles started to expire is:

a) If the user comes back X days after their last login to use the computer again, they can't log on at all with a "The User Profile Service failed the logon. User profile cannot be loaded." error.

b) The user profile folder still exists - it's just empty. Not really a problem in itself - but could be a symptom/cause of a)?

The problem profile SIDs are removed (no longer listed in the registry under Local_Machine\..\Windows NT\CurrentVersion\ProfileList or in Advanced System Settings > User Profiles.

The policy has been turned off so it won't affect any more people, but why is this preventing those old users from logging back in? I'd expect Windows to just rebuild the profile like it would for a brand new user, instead it errors out.

I know Vista has a hotfix for a problem relating to that policy, but that was for premature deletion, not this error. 7 doesn't appear to have any related updates.

Just had a bad thought: could that policy have deleted the Default profile? I'm not going to have direct access to the problem machines again until next week, I wonder if the guy who built that image did something kooky when setting it up that would allow that.

edit: the error also happens for a user account that has never logged into the machine as well. That does sound like a Default profile problem.

edit2: Fuck. Advanced System Settings > User Profiles, for one computer, there is no entry for Default profile. The other one has it, but zero bytes. Looks like I'm going to have to re-install the suckers when I'm back next week unless if anyone knows a quick way of re-establishing a new default profile for the system. I'll try a System Restore first, with luck it'll save it. Either way it'll have to wait.

How the hell could that policy delete the default profile anyways? Can a machine be set so that the default profile is C:\Users\someguy instead of the hidden Default user folder?
Stayed late & managed to get it fixed.

System Restore brought back the default profile, but then broke the trust relationship with the domain. Leaving & rejoining the domain under a new PC name fixed that. Domain users with no existing profile (either old & deleted, or never existed on that PC) are now able to log in normally.

The question remains though: why did the profile expiry policy delete the default profile?
sounds like a bug..
It also sounds like it isn't worth the effort to delete old profiles either. They do not take up that much space.
If they're not saving a lot of things locally (as is the case of this test group), then no. But if they have a lot of local content in the usual places (Desktop, Documents, Pictures, etc) and they're not redirected folders, then it will add up.

Also depends on how multi-user the computers will be. In the group where I tested these two machines, we can expect at least 50 new profile per year on each PC, which isn't really that much given that they're not saving a lot of local content. I guess places that really have a lot of users rotating through will either Deepfreeze so no profiles persist between reboots, use a mandatory profile that overwrite changes on each log-in, and/or re-image regularly.

First two weren't really appropriate since we want the profile (and the user files saved within it) to persist through the term, so profile expiry seemed ideal.

There are probably other options, but this aspect of IT is kind of new to me.
Another option would be virtual desktops that get "re-imaged" each time the system is booted.

The new virtual PC is loaded from a server every time. So the system always stays clean and fresh.
Here's yet another option. Just set it up as a scheduled task. ... tion-tool/
Thanks for reminding me. I did find delprof2 before learning about the GPO, which seemed like the better way to go until I had this hiccup. I'm going to check it out again this week.
WOw, Delprof2...thanks for the link...Ive got the same problem as the poster, but get 50-60 per week

(side note for a laugh...I had previously used DelProf, scripted in a batch file to cleanup XP machines....had decided to switch to timeframe to 2 days, then decided to use a 'users machines' OU export.
Worked great, but I shouldnt have ran it at 1am Monday (deleted everyone who didnt log in Sat/Sun...managers, directors, HR folks...)
Sterling_Aug wrote:

In the end, I think this is what we'll do. Too much other stuff to worry about to spend any more time on this.
I work for the PA State Police IT desktop support group and we have some PCs around the state with hundreds of user profiles on them.

The only time they get deleted is when the PC gets reimaged.
11 posts