0

I know that you shouldn't just delete the folder in c:\Documents & Settings (or wherever) and should also delete "something" from the registry under HKEY_USERS. We sometimes want to delete all the user profiles off a XenApp server.

Bombprof works well - looks like it's crashed at start-up but it's just busy enumurating all the profiles. You can have hundreds on a XenApp server.

But we want to try and script the operation, maybe deleting profiles that are dormant. Any tips on how to cleanup the registry side as well? I've loaded regedit as administrator and HKEY_USERS doesn't list all users. I suspect just the current loaded ones.

Cheers, Rob.

PS. Is this really a StackOverflow question as it's going to have a programming solution?

1 Answer 1

1

The profile key you're looking for is HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. This is a list of all cached profiles on the machine, along with the profilepath. If you delete an entry from this list along with it's corresponding folder in documents and settings (or "users" on newer OSes) it is completely removed.

The HKEY_Users and HKEY_CurrentUser registry entries are in fact stored in NTUSER.dat for each users, and this file exists in the users folder (documents and settings). So, removing the folder will effectively wipe that user's portion of the registry as well.

Shouldn't be too hard to script something around it, just make sure you don't touch the built-in user profiles such as LocalService, NetworkService and SystemProfile.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .