:
you're reading...
Windows 7

Deleting Windows 7 Profiles

Just a quicky, as I did say that l might discuss removing windows 7 profiles in a bit more detail in a previous post entitled ‘User State Virtualisation’.  During a recent completed Windows 7 design l noticed the process has changed slightly since the days of Windows XP and l’ve seen a few individuals making profile issues worse, which never looks good!

Its no longer possible to just delete / rename the local profile folders, as many support teams are used to with Windows XP, additionally there are now Security Identifiers (SID) registry entries within a ‘ProfileList’ key that list all user profiles currently cached on the computer.  If you delete the local profile folder without removing the corresponding registry keys, the user will then receive a profile error message during logon and receive a temporary profile *annoying*. “Error : The User Profile Service failed the logon. User profile cannot be loaded”

Now obviously this can be done locally or remotely depending on your security permissions, but l think we’ll stick with locally. Firstly make sure that there are no users logged into the computers [apart from you!] and ensure the user is not logged onto another computer (just in case your implementing roaming profiles..).

Process

1. Navigate to the ‘Users’ folder and find the user’s local profile, in our case ‘ABITBYB’. Now you have a choice to rename or delete; preferably rename appending the date and the name of the administrator.  By including the date and the administrator’s name we can use the data to learn support trends, and possible large profile corruption issues (roaming profile?). [If remote] – Map the clients C$ administrator share, or navigate to the UNC \\computer\c$

2. Now that we’ve completed the easy bit, the next part is the most important! Launch ‘Regedit’ using your administrator credentials. [If remote] – Click ‘Connect Network Registry’ and search for the computer and click OK.

3. Now the registry location you’re after is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

4. Find the folder under ‘ProfileList’ that references the user account your attempting to delete by checking ‘ProfileImagePath’.  As we can see in the image below each folder is distinguished via a generate SID, now i’m going to discuss how to link this to a user…but it is possible.  Anyway instead look in each SID starting with S-1-5-21, checking ‘ProfileImagePath’ for the folder deleted/renamed in step 1; in my case “C:\Users\ABITBYB”.

5. Now the easiest thing to do is delete the entire key, from the SID not ProfileList! Simple.

Real worldy stuff

  • People shouldn’t be too hasty to delete local profiles, call statistics ruin IT support causing no root diagnosis!
  • If no new users are able to logon then check the default user profile; ‘C:\Users\Default’, as this maybe corrupted or even *missing*.
  • Now if your support teams are not proficient with registry editing (locally or remotely) or you want to treat them to an inexpensive! unsupported tool it might be wise to automate a simple solution.  AutoIT is a godsend for these scenarios if you want to provide a GUI rich alternative to VBscript or HTAs.

Heres one l made earlier! Which l can use to remotely (or locally even) delete / rename Windows 7 profiles. #coolandgeeky!

 

Links for more information

Error message: “The User Profile Service failed the logon. User profile cannot be loaded”, when logging on to Windows 7 or Windows Vista – http://support.microsoft.com/kb/947215

“DelProf the second”

Well not a quick post, but it does suprise me that Microsoft don’t provide a tool for enterprises, like the old DelProf for XP.  Helge Klein @ http://helgeklein.com has though created a nifty tool for deleting Windows 7 profiles, cleverly entitled DelProf2! Can be used one off or scripted to periodically clean the profile list, worth a look!

About Ben Barlow

A London based Technical Design Authority.

Discussion

No comments yet.

Leave a comment